diff --git a/ui/widgets/nuxeo-date-picker.js b/ui/widgets/nuxeo-date-picker.js index 3486a72e9..3e1be5690 100644 --- a/ui/widgets/nuxeo-date-picker.js +++ b/ui/widgets/nuxeo-date-picker.js @@ -128,7 +128,7 @@ import { I18nBehavior } from '../nuxeo-i18n-behavior.js'; /** * Use this property to provide custom date format */ - dateFormat: { + format: { type: String, value: '', }, @@ -195,7 +195,7 @@ import { I18nBehavior } from '../nuxeo-i18n-behavior.js'; moment.locale(window.nuxeo.I18n.language ? window.nuxeo.I18n.language.split('-')[0] : 'en'); // tell vaadin-date-picker how to display dates since default behavior is US locales (MM-DD-YYYY) // this way we can take advantage of moment locale and use the date format that is most suitable for the user - const convertedFormat = this.dateFormat ? this.dateFormat : moment.localeData().longDateFormat('L'); + const convertedFormat = this.format ? this.format : moment.localeData().longformat('L'); this.$.date.set('i18n.formatDate', (date) => this._moment(date).format(convertedFormat)); this.$.date.set('i18n.parseDate', (text) => { const date = this._moment(text, convertedFormat);