From deed3d5b8b01215ef3f0e4610b4fe89b8118f1ff Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 29 Dec 2024 18:47:49 +0200 Subject: [PATCH] ref --- client/src/ui/datepicker.js | 13 +++---------- client/src/views/fields/date.js | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/client/src/ui/datepicker.js b/client/src/ui/datepicker.js index 76d95a6137..ee8380f2bd 100644 --- a/client/src/ui/datepicker.js +++ b/client/src/ui/datepicker.js @@ -54,17 +54,10 @@ class Datepicker { @inject(Settings) config - /** - * @private - * @type {DateTime} - */ - @inject(DateTime) - dateTime - /** * @param {HTMLElement} element * @param {{ - * format?: string, + * format: string, * weekStart: number, * todayButton?: boolean, * startDate?: string|undefined, @@ -102,7 +95,7 @@ class Datepicker { const language = this.config.get('language'); - const format = options.format || this.dateTime.getDateFormat(); + const format = options.format; const datepickerOptions = { autoclose: true, @@ -113,7 +106,7 @@ class Datepicker { format: format.toLowerCase(), weekStart: options.weekStart, todayBtn: options.todayButton || false, - startDate: options.startDate || this.dateTime.toMomentDate('1970-01-01').format(format), + startDate: options.startDate, orientation: 'bottom auto', templates: { leftArrow: '', diff --git a/client/src/views/fields/date.js b/client/src/views/fields/date.js index 5dd398e2d3..23a0c9a073 100644 --- a/client/src/views/fields/date.js +++ b/client/src/views/fields/date.js @@ -310,7 +310,7 @@ class DateFieldView extends BaseFieldView { const options = { format: this.getDateTime().dateFormat, weekStart: this.getDateTime().weekStart, - startDate: this.getStartDateForDatePicker(), + startDate: this.getStartDateForDatePicker() || this.getDateTime().toDisplayDate('1970-01-01'), todayButton: this.getConfig().get('datepickerTodayButton') || false, };