0.0.318 work with datarangepicker.js

This commit is contained in:
2023-12-05 20:16:44 +03:00
parent 75ddb002fd
commit b23e440efd
2 changed files with 74 additions and 43 deletions

View File

@@ -5,35 +5,6 @@
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
// let locale_ru = {
// direction: "ltr",
// // format: t.localeData().longDateFormat("L"),
// format: "DD.MM.YYYY",
// separator: " - ",
// applyLabel: "Принять",
// cancelLabel: "Отменить",
// weekLabel: "Н",
// customRangeLabel: "Custom Range",
// daysOfWeek: t.weekdaysMin(),
// monthNames: t.monthsShort(),
// firstDay: t.localeData().firstDayOfWeek()
// };
// let locale_en = {
// direction: "ltr",
// // format: t.localeData().longDateFormat("L"),
// format: "DD.MM.YYYY",
// separator: " - ",
// applyLabel: "Apply",
// cancelLabel: "Cancel",
// weekLabel: "W",
// customRangeLabel: "Custom Range",
// daysOfWeek: t.weekdaysMin(),
// monthNames: t.monthsShort(),
// firstDay: t.localeData().firstDayOfWeek()
// };
!function(t,e) {
@@ -79,19 +50,26 @@
this.buttonClasses = "btn btn-sm",
this.applyButtonClasses = "btn-primary",
this.cancelButtonClasses = "btn-default",
this.locale = {
direction: "ltr",
// format: t.localeData().longDateFormat("L"),
format: "DD.MM.YYYY",
separator: " - ",
applyLabel: "Принять",
cancelLabel: "Отменить",
weekLabel: "Н",
customRangeLabel: "Custom Range",
daysOfWeek: t.weekdaysMin(),
monthNames: t.monthsShort(),
firstDay: t.localeData().firstDayOfWeek()
}, this.callback = function () {
this.locale = i.locale,
this.locale.daysOfWeek = t.weekdaysMin(),
this.locale.monthNames = t.monthsShort(),
this.locale.firstDay = t.localeData().firstDayOfWeek(),
// this.locale = {
// direction: "ltr",
// // format: t.localeData().longDateFormat("L"),
// format: "DD.MM.YYYY",
// separator: " - ",
// applyLabel: "Принять",
// cancelLabel: "Отменить",
// weekLabel: "Н",
// customRangeLabel: "Custom Range",
// daysOfWeek: t.weekdaysMin(),
// monthNames: t.monthsShort(),
// firstDay: t.localeData().firstDayOfWeek()
// }
this.callback = function () {
}, this.isShowing = !1, this.leftCalendar = {}, this.rightCalendar = {}, "object" == typeof i && null !== i || (i = {}), "string" == typeof (i = e.extend(this.element.data(), i)).template || i.template instanceof e || (i.template = '<div class="daterangepicker"><div class="ranges"></div><div class="drp-calendar left"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-calendar right"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-buttons"><span class="drp-selected"></span><button class="cancelBtn" type="button"></button><button class="applyBtn" disabled="disabled" type="button"></button> </div></div>'), this.parentEl = i.parentEl && e(i.parentEl).length ? e(i.parentEl) : e(this.parentEl), this.container = e(i.template).appendTo(this.parentEl), "object" == typeof i.locale && ("string" == typeof i.locale.direction && (this.locale.direction = i.locale.direction), "string" == typeof i.locale.format && (this.locale.format = i.locale.format), "string" == typeof i.locale.separator && (this.locale.separator = i.locale.separator), "object" == typeof i.locale.daysOfWeek && (this.locale.daysOfWeek = i.locale.daysOfWeek.slice()), "object" == typeof i.locale.monthNames && (this.locale.monthNames = i.locale.monthNames.slice()), "number" == typeof i.locale.firstDay && (this.locale.firstDay = i.locale.firstDay), "string" == typeof i.locale.applyLabel && (this.locale.applyLabel = i.locale.applyLabel), "string" == typeof i.locale.cancelLabel && (this.locale.cancelLabel = i.locale.cancelLabel), "string" == typeof i.locale.weekLabel && (this.locale.weekLabel = i.locale.weekLabel), "string" == typeof i.locale.customRangeLabel)) {
(p = document.createElement("textarea")).innerHTML = i.locale.customRangeLabel;
var n = p.value;