mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Fix inverted scrolling issue for date selectors
This commit is contained in:
parent
bb372ec424
commit
ac83979ed0
@ -90,7 +90,7 @@ var datetimepickerFactory = function ($) {
|
||||
'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
|
||||
],
|
||||
dayOfWeekShort: [
|
||||
"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
|
||||
"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
|
||||
],
|
||||
dayOfWeek: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"]
|
||||
},
|
||||
@ -541,6 +541,15 @@ var datetimepickerFactory = function ($) {
|
||||
"კვ", "ორშ", "სამშ", "ოთხ", "ხუთ", "პარ", "შაბ"
|
||||
],
|
||||
dayOfWeek: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი"]
|
||||
},
|
||||
kk: { // Kazakh
|
||||
months: [
|
||||
'Қаңтар', 'Ақпан', 'Наурыз', 'Сәуір', 'Мамыр', 'Маусым', 'Шілде', 'Тамыз', 'Қыркүйек', 'Қазан', 'Қараша', 'Желтоқсан'
|
||||
],
|
||||
dayOfWeekShort: [
|
||||
"Жк", "Дс", "Сс", "Ср", "Бс", "Жм", "Сб"
|
||||
],
|
||||
dayOfWeek: ["Жексенбі", "Дүйсенбі", "Сейсенбі", "Сәрсенбі", "Бейсенбі", "Жұма", "Сенбі"]
|
||||
}
|
||||
},
|
||||
|
||||
@ -806,7 +815,7 @@ var datetimepickerFactory = function ($) {
|
||||
|
||||
deltaY *= 10;
|
||||
|
||||
if ('deltaY' in e) { deltaY = e.deltaY; }
|
||||
if ('deltaY' in e) { deltaY = -e.deltaY; }
|
||||
|
||||
if (deltaY && e.deltaMode) {
|
||||
if (e.deltaMode === 1) {
|
||||
@ -1646,7 +1655,18 @@ var datetimepickerFactory = function ($) {
|
||||
var pheight = timeboxparent[0].clientHeight,
|
||||
height = timebox[0].offsetHeight,
|
||||
top = Math.abs(parseInt(timebox.css('marginTop'), 10));
|
||||
if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) {
|
||||
/**
|
||||
* Fixes a bug which happens if:
|
||||
* top is < the timeHeightInTimePicker, it will cause the up arrow to stop working
|
||||
* same for the down arrow if it's not exactly on the pixel
|
||||
*/
|
||||
if (top < options.timeHeightInTimePicker) {
|
||||
top = options.timeHeightInTimePicker;
|
||||
} else if ($this.hasClass(options.next) && (height - pheight) < top) {
|
||||
timebox.css('marginTop', '-' + height + 'px');
|
||||
}
|
||||
|
||||
if ($this.hasClass(options.next) && (height - pheight) > top) {
|
||||
timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
|
||||
} else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
|
||||
timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
|
||||
@ -1685,7 +1705,7 @@ var datetimepickerFactory = function ($) {
|
||||
clearTimeout(xchangeTimer);
|
||||
xchangeTimer = setTimeout(function () {
|
||||
|
||||
if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
|
||||
if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null || isNaN(_xdsoft_datetime.currentTime.getTime())) {
|
||||
_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
|
||||
}
|
||||
|
||||
|
2
build/jquery.datetimepicker.full.min.js
vendored
2
build/jquery.datetimepicker.full.min.js
vendored
File diff suppressed because one or more lines are too long
2
build/jquery.datetimepicker.min.js
vendored
2
build/jquery.datetimepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@ -805,7 +805,7 @@ var datetimepickerFactory = function ($) {
|
||||
|
||||
deltaY *= 10;
|
||||
|
||||
if ('deltaY' in e) { deltaY = e.deltaY; }
|
||||
if ('deltaY' in e) { deltaY = -e.deltaY; }
|
||||
|
||||
if (deltaY && e.deltaMode) {
|
||||
if (e.deltaMode === 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user