From 45f02660115411ca24540979e2ddb7974d9bcb1c Mon Sep 17 00:00:00 2001 From: swarnadipa choudhury <67375320+swarnadipa-dev@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:53:46 +0530 Subject: [PATCH] revert expose date format changes (#938) --- ui/widgets/nuxeo-date-picker.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ui/widgets/nuxeo-date-picker.js b/ui/widgets/nuxeo-date-picker.js index 0091e8a15..fcfc33f8b 100644 --- a/ui/widgets/nuxeo-date-picker.js +++ b/ui/widgets/nuxeo-date-picker.js @@ -125,13 +125,6 @@ import { I18nBehavior } from '../nuxeo-i18n-behavior.js'; type: Boolean, value: false, }, - /** - * Use this property to provide custom date format - */ - format: { - type: String, - value: '', - }, }; } @@ -195,11 +188,9 @@ 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 - this.$.date.set('i18n.formatDate', (date) => - this._moment(date).format(this.format ? this.format : moment.localeData().longDateFormat('L')), - ); + this.$.date.set('i18n.formatDate', (date) => this._moment(date).format(moment.localeData().longDateFormat('L'))); this.$.date.set('i18n.parseDate', (text) => { - const date = this._moment(text, this.format ? this.format : moment.localeData().longDateFormat('L')); + const date = this._moment(text, moment.localeData().longDateFormat('L')); return { day: date.get('D'), month: date.get('M'),