diff --git a/application/Espo/Resources/i18n/en_US/Global.json b/application/Espo/Resources/i18n/en_US/Global.json index 89774b4cfb..5923ae034a 100644 --- a/application/Espo/Resources/i18n/en_US/Global.json +++ b/application/Espo/Resources/i18n/en_US/Global.json @@ -174,7 +174,8 @@ "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] + "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }, "options": { "salutationName": { diff --git a/frontend/client/src/views/fields/date.js b/frontend/client/src/views/fields/date.js index 9e4b479441..235c4a43b2 100644 --- a/frontend/client/src/views/fields/date.js +++ b/frontend/client/src/views/fields/date.js @@ -86,7 +86,29 @@ Espo.define('Views.Fields.Date', 'Views.Fields.Base', function (Dep) { weekStart: this.getDateTime().weekStart, autoclose: true, todayHighlight: true, - }; + }; + + var language = this.getSettings().get('language'); + + if (!(language in $.fn.datepicker.dates)) { + $.fn.datepicker.dates[language] = { + days: this.translate('dayNames', 'lists'), + daysShort: this.translate('dayNamesShort', 'lists'), + daysMin: this.translate('dayNamesMin', 'lists'), + months: this.translate('monthNames', 'lists'), + monthsShort: this.translate('monthNamesShort', 'lists'), + today: this.translate('Today'), + clear: this.translate('Clear'), + }; + } + + var options = { + format: this.getDateTime().dateFormat.toLowerCase(), + weekStart: this.getDateTime().weekStart, + autoclose: true, + todayHighlight: true, + language: language + }; this.$element.datepicker(options);