mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Merge pull request #725 from Lukom/feature/fix-ukrainian-short-day-names
Fix ukrainian short day names
This commit is contained in:
commit
cda4cbc903
@ -80,7 +80,7 @@ var datetimepickerFactory = function ($) {
|
||||
'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
|
||||
],
|
||||
dayOfWeekShort: [
|
||||
"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
|
||||
"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
|
||||
],
|
||||
dayOfWeek: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"]
|
||||
},
|
||||
@ -676,7 +676,7 @@ var datetimepickerFactory = function ($) {
|
||||
parseDate: function (date, format) {
|
||||
if(isFormatStandard(format)){
|
||||
return defaultDateHelper.parseDate(date, format);
|
||||
}
|
||||
}
|
||||
var d = moment(date, format);
|
||||
return d.isValid() ? d.toDate() : false;
|
||||
},
|
||||
@ -684,7 +684,7 @@ var datetimepickerFactory = function ($) {
|
||||
formatDate: function (date, format) {
|
||||
if(isFormatStandard(format)){
|
||||
return defaultDateHelper.formatDate(date, format);
|
||||
}
|
||||
}
|
||||
return moment(date).format(format);
|
||||
},
|
||||
|
||||
@ -717,7 +717,7 @@ var datetimepickerFactory = function ($) {
|
||||
if(typeof dateFormatter === 'string' && dateFormatters.hasOwnProperty(dateFormatter)){
|
||||
var df = dateFormatters[dateFormatter];
|
||||
$.extend(default_options, df.default_options);
|
||||
dateHelper = df.formatter;
|
||||
dateHelper = df.formatter;
|
||||
}
|
||||
else {
|
||||
dateHelper = dateFormatter;
|
||||
@ -1760,26 +1760,26 @@ var datetimepickerFactory = function ($) {
|
||||
classes.push('xdsoft_disabled');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(options.allowDates && options.allowDates.length>0){
|
||||
if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){
|
||||
classes.push('xdsoft_disabled');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var currentDay = ((start.getFullYear() * 12) + start.getMonth()) * 31 + start.getDate();
|
||||
if ((maxDate !== false && start > maxDate) || (minDateTime !== false && start < minDateTime) || (minDate !== false && start < minDate) || (maxDateTime !== false && currentDay > maxDateTimeDay) || (customDateSettings && customDateSettings[0] === false)) {
|
||||
classes.push('xdsoft_disabled');
|
||||
}
|
||||
|
||||
|
||||
if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
|
||||
classes.push('xdsoft_disabled');
|
||||
}
|
||||
|
||||
|
||||
if (options.disabledWeekDays.indexOf(day) !== -1) {
|
||||
classes.push('xdsoft_disabled');
|
||||
}
|
||||
|
||||
|
||||
if (input.is('[disabled]')) {
|
||||
classes.push('xdsoft_disabled');
|
||||
}
|
||||
@ -2407,7 +2407,7 @@ var datetimepickerFactory = function ($) {
|
||||
var valueBeforeCursor = val.substr(0, pos);
|
||||
var valueAfterPaste = val.substr(pos + pastedData.length);
|
||||
|
||||
val = valueBeforeCursor + pastedData + valueAfterPaste;
|
||||
val = valueBeforeCursor + pastedData + valueAfterPaste;
|
||||
pos += pastedData.length;
|
||||
|
||||
if (isValidValue(options.mask, val)) {
|
||||
@ -2433,7 +2433,7 @@ var datetimepickerFactory = function ($) {
|
||||
|
||||
// only alow these characters
|
||||
if (((key >= KEY0 && key <= KEY9) ||
|
||||
(key >= _KEY0 && key <= _KEY9)) ||
|
||||
(key >= _KEY0 && key <= _KEY9)) ||
|
||||
(key === BACKSPACE || key === DEL)) {
|
||||
|
||||
// get char to insert which is new character or placeholder ('_')
|
||||
@ -2464,7 +2464,7 @@ var datetimepickerFactory = function ($) {
|
||||
pos += (key === BACKSPACE && !hasSel) ? -1 : 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (event.metaKey) { // cmd has been pressed
|
||||
pos = 0;
|
||||
hasSel = true;
|
||||
@ -2476,7 +2476,7 @@ var datetimepickerFactory = function ($) {
|
||||
|
||||
// if we have a selection length we will wipe out entire selection and replace with default template for that range
|
||||
var defaultBlank = options.mask.replace(/[0-9]/g, '_');
|
||||
var defaultBlankSelectionReplacement = defaultBlank.substr(pos, selLength);
|
||||
var defaultBlankSelectionReplacement = defaultBlank.substr(pos, selLength);
|
||||
var selReplacementRemainder = defaultBlankSelectionReplacement.substr(1) // might be empty
|
||||
|
||||
var valueBeforeSel = val.substr(0, pos);
|
||||
|
Loading…
Reference in New Issue
Block a user