Skip to content

EspoCRM – Open Source CRM Application

ref

Yuri Kuznetsovdeed3d5b8b01
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: '<span class="fas fa-chevron-left fa-sm"></span>',
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,
};