0.0.268
This commit is contained in:
@@ -147,9 +147,9 @@
|
||||
this.timePicker && (this.renderTimePicker("left"), this.renderTimePicker("right"), this.endDate ? this.container.find(".right .calendar-time select").prop("disabled", !1).removeClass("disabled") : this.container.find(".right .calendar-time select").prop("disabled", !0).addClass("disabled")), this.endDate && this.container.find(".drp-selected").html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)), this.updateMonthsInView(), this.updateCalendars(), this.updateFormInputs()
|
||||
}, updateMonthsInView: function () {
|
||||
if (this.endDate) {
|
||||
if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && (this.startDate.format("YYYY-MM") == this.leftCalendar.month.format("YYYY-MM") || this.startDate.format("YYYY-MM") == this.rightCalendar.month.format("YYYY-MM")) && (this.endDate.format("YYYY-MM") == this.leftCalendar.month.format("YYYY-MM") || this.endDate.format("YYYY-MM") == this.rightCalendar.month.format("YYYY-MM"))) return;
|
||||
if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && (this.startDate.format("MM.YYYY") == this.leftCalendar.month.format("MM.YYYY") || this.startDate.format("MM.YYYY") == this.rightCalendar.month.format("MM.YYYY")) && (this.endDate.format("MM.YYYY") == this.leftCalendar.month.format("MM.YYYY") || this.endDate.format("MM.YYYY") == this.rightCalendar.month.format("MM.YYYY"))) return;
|
||||
this.leftCalendar.month = this.startDate.clone().date(2), this.linkedCalendars || this.endDate.month() == this.startDate.month() && this.endDate.year() == this.startDate.year() ? this.rightCalendar.month = this.startDate.clone().date(2).add(1, "month") : this.rightCalendar.month = this.endDate.clone().date(2)
|
||||
} else this.leftCalendar.month.format("YYYY-MM") != this.startDate.format("YYYY-MM") && this.rightCalendar.month.format("YYYY-MM") != this.startDate.format("YYYY-MM") && (this.leftCalendar.month = this.startDate.clone().date(2), this.rightCalendar.month = this.startDate.clone().date(2).add(1, "month"));
|
||||
} else this.leftCalendar.month.format("MM.YYYY") != this.startDate.format("MM.YYYY") && this.rightCalendar.month.format("MM.YYYY") != this.startDate.format("MM.YYYY") && (this.leftCalendar.month = this.startDate.clone().date(2), this.rightCalendar.month = this.startDate.clone().date(2).add(1, "month"));
|
||||
this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate && (this.rightCalendar.month = this.maxDate.clone().date(2), this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, "month"))
|
||||
}, updateCalendars: function () {
|
||||
if (this.timePicker) {
|
||||
@@ -357,12 +357,12 @@
|
||||
var t = !0, e = 0;
|
||||
for (var a in this.ranges) {
|
||||
if (this.timePicker) {
|
||||
var i = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm";
|
||||
var i = this.timePickerSeconds ? "DD.MM.YYYY:mm:ss" : "DD.MM.YYYY HH:mm";
|
||||
if (this.startDate.format(i) == this.ranges[a][0].format(i) && this.endDate.format(i) == this.ranges[a][1].format(i)) {
|
||||
t = !1, this.chosenLabel = this.container.find(".ranges li:eq(" + e + ")").addClass("active").attr("data-range-key");
|
||||
break
|
||||
}
|
||||
} else if (this.startDate.format("YYYY-MM-DD") == this.ranges[a][0].format("YYYY-MM-DD") && this.endDate.format("YYYY-MM-DD") == this.ranges[a][1].format("YYYY-MM-DD")) {
|
||||
} else if (this.startDate.format("DD.MM.YYYY") == this.ranges[a][0].format("DD.MM.YYYY") && this.endDate.format("DD.MM.YYYY") == this.ranges[a][1].format("DD.MM.YYYY")) {
|
||||
t = !1, this.chosenLabel = this.container.find(".ranges li:eq(" + e + ")").addClass("active").attr("data-range-key");
|
||||
break
|
||||
}
|
||||
@@ -389,7 +389,7 @@
|
||||
}
|
||||
if (i) {
|
||||
var h = this.startDate.clone();
|
||||
h.hour(s), h.minute(n), h.second(r), this.setStartDate(h), this.singleDatePicker ? this.endDate = this.startDate.clone() : this.endDate && this.endDate.format("DD-MM-YYYY") == h.format("DD-MM-YYYY") && this.endDate.isBefore(h) && this.setEndDate(h.clone())
|
||||
h.hour(s), h.minute(n), h.second(r), this.setStartDate(h), this.singleDatePicker ? this.endDate = this.startDate.clone() : this.endDate && this.endDate.format("DD.MM.YYYY") == h.format("DD.MM.YYYY") && this.endDate.isBefore(h) && this.setEndDate(h.clone())
|
||||
} else if (this.endDate) {
|
||||
var l = this.endDate.clone();
|
||||
l.hour(s), l.minute(n), l.second(r), this.setEndDate(l)
|
||||
|
||||
Reference in New Issue
Block a user