-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When a DateField is displayed for editing it is formated as described by the format parameter form for ex. yyyy-MM-dd HH:mm.
When the DateField is displayed readonly it is formated via the current locale for ex. d.m.yyyy HH:mm.
Expactation:
The format of the field is always the same for editing and readonly when a format is given using the format otherwise the locale.
A solution could be:
import format from 'date-fns/format';
....
getDisplayValue() {
return this.isBlank()
? null
: (this.get('format') ? format(new Date(this.getValue()), this.get('format')) : this._toLocaleString(new Date(this.getValue())));
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working