This commit is contained in:
Yuri Kuznetsov
2024-12-29 18:47:49 +02:00
parent 70d27c78bb
commit deed3d5b8b
2 changed files with 4 additions and 11 deletions
+3 -10
View File
@@ -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: '<span class="fas fa-chevron-left fa-sm"></span>',
+1 -1
View File
@@ -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,
};