translate js calendar

This commit is contained in:
Yuri Kuznetsov
2014-04-30 14:59:55 +03:00
parent 41d1a359c4
commit e1139bd63e
2 changed files with 25 additions and 2 deletions
@@ -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": {
+23 -1
View File
@@ -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);