You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to figure out how to display properly the date field as readonly.
It is not a disabled field, so it should not be visually grayed out (like using the formControl's disable-method), just must be not modifiable.
Exactly like the [readonly]=true works for input-fields. But surprisingly, p-datePicker doesn't have an attribute readonly.
Is it on purpose? Is there any workarounds?
Ok, I have decided to display the field as an input, if it is readonly:
looks ugly in code, but works partially: now I have another problem - with a date format presentation.
The value in the FormControl is actually Date('YYYY-MM-DD'), exactly so it is being displayed in the input field.
But I need a presentation like DD.MM.YYYY.
Can I provide my pipe for displaying the value or define the format to present the value?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hallo,
I am trying to figure out how to display properly the date field as readonly.
It is not a disabled field, so it should not be visually grayed out (like using the formControl's disable-method), just must be not modifiable.
Exactly like the [readonly]=true works for input-fields. But surprisingly, p-datePicker doesn't have an attribute readonly.
Is it on purpose? Is there any workarounds?
Ok, I have decided to display the field as an input, if it is readonly:
looks ugly in code, but works partially: now I have another problem - with a date format presentation.
The value in the FormControl is actually Date('YYYY-MM-DD'), exactly so it is being displayed in the input field.
But I need a presentation like DD.MM.YYYY.
Can I provide my pipe for displaying the value or define the format to present the value?
Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions