diff --git a/src/main/webapp/resources/3rd-party/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.js b/src/main/webapp/resources/3rd-party/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.js
index c39c9ec..e10f157 100644
--- a/src/main/webapp/resources/3rd-party/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.js
+++ b/src/main/webapp/resources/3rd-party/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.js
@@ -1,2271 +1,2062 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if (typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("jQuery"));
- else if (typeof define === 'function' && define.amd)
- define(["jQuery"], factory);
- else {
- var a = typeof exports === 'object' ? factory(require("jQuery")) : factory(root["jQuery"]);
- for (var i in a)
- (typeof exports === 'object' ? exports : root)[i] = a[i];
+/*!
+ * Datepicker for Bootstrap v1.10.0 (https://github.com/uxsolutions/bootstrap-datepicker)
+ *
+ * Licensed under the Apache License v2.0 (https://www.apache.org/licenses/LICENSE-2.0)
+ */
+
+(function(factory){
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function($, undefined){
+ function UTCDate(){
+ return new Date(Date.UTC.apply(Date, arguments));
+ }
+ function UTCToday(){
+ var today = new Date();
+ return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
+ }
+ function isUTCEquals(date1, date2) {
+ return (
+ date1.getUTCFullYear() === date2.getUTCFullYear() &&
+ date1.getUTCMonth() === date2.getUTCMonth() &&
+ date1.getUTCDate() === date2.getUTCDate()
+ );
+ }
+ function alias(method, deprecationMsg){
+ return function(){
+ if (deprecationMsg !== undefined) {
+ $.fn.datepicker.deprecated(deprecationMsg);
+ }
+
+ return this[method].apply(this, arguments);
+ };
+ }
+ function isValidDate(d) {
+ return d && !isNaN(d.getTime());
+ }
+
+ var DateArray = (function(){
+ var extras = {
+ get: function(i){
+ return this.slice(i)[0];
+ },
+ contains: function(d){
+ // Array.indexOf is not cross-browser;
+ // $.inArray doesn't work with Dates
+ var val = d && d.valueOf();
+ for (var i=0, l=this.length; i < l; i++)
+ // Use date arithmetic to allow dates with different times to match
+ if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24)
+ return i;
+ return -1;
+ },
+ remove: function(i){
+ this.splice(i,1);
+ },
+ replace: function(new_array){
+ if (!new_array)
+ return;
+ if (!Array.isArray(new_array))
+ new_array = [new_array];
+ this.clear();
+ this.push.apply(this, new_array);
+ },
+ clear: function(){
+ this.length = 0;
+ },
+ copy: function(){
+ var a = new DateArray();
+ a.replace(this);
+ return a;
+ }
+ };
+
+ return function(){
+ var a = [];
+ a.push.apply(a, arguments);
+ $.extend(a, extras);
+ return a;
+ };
+ })();
+
+
+ // Picker object
+
+ var Datepicker = function(element, options){
+ $.data(element, 'datepicker', this);
+
+ this._events = [];
+ this._secondaryEvents = [];
+
+ this._process_options(options);
+
+ this.dates = new DateArray();
+ this.viewDate = this.o.defaultViewDate;
+ this.focusDate = null;
+
+ this.element = $(element);
+ this.isInput = this.element.is('input');
+ this.inputField = this.isInput ? this.element : this.element.find('input');
+ this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn') : false;
+ if (this.component && this.component.length === 0){
+ this.component = false;
}
-}
-)(self, function(__WEBPACK_EXTERNAL_MODULE_jquery__) {
- return (function() {
- // webpackBootstrap
-
- var __webpack_modules__ = (
- {
- "./libs/bootstrap-datepicker/bootstrap-datepicker.js": (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
-
- var bootstrap_datepicker_dist_js_bootstrap_datepicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js");
-
- var bootstrap_datepicker_dist_js_bootstrap_datepicker__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(bootstrap_datepicker_dist_js_bootstrap_datepicker__WEBPACK_IMPORTED_MODULE_0__);
-
-
- }),
-
-
- "./node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js": (function(module, exports, __webpack_require__) {
-
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker)
- *
- * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
- */
-
- (function(factory){
- if (true) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__("jquery")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }(function($, undefined){
- function UTCDate(){
- return new Date(Date.UTC.apply(Date, arguments));
- }
- function UTCToday(){
- var today = new Date();
- return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
- }
- function isUTCEquals(date1, date2) {
- return (
- date1.getUTCFullYear() === date2.getUTCFullYear() &&
- date1.getUTCMonth() === date2.getUTCMonth() &&
- date1.getUTCDate() === date2.getUTCDate()
- );
- }
- function alias(method, deprecationMsg){
- return function(){
- if (deprecationMsg !== undefined) {
- $.fn.datepicker.deprecated(deprecationMsg);
- }
-
- return this[method].apply(this, arguments);
- };
- }
- function isValidDate(d) {
- return d && !isNaN(d.getTime());
- }
-
- var DateArray = (function(){
- var extras = {
- get: function(i){
- return this.slice(i)[0];
- },
- contains: function(d){
- // Array.indexOf is not cross-browser;
- // $.inArray doesn't work with Dates
- var val = d && d.valueOf();
- for (var i=0, l=this.length; i < l; i++)
- // Use date arithmetic to allow dates with different times to match
- if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24)
- return i;
- return -1;
- },
- remove: function(i){
- this.splice(i,1);
- },
- replace: function(new_array){
- if (!new_array)
- return;
- if (!$.isArray(new_array))
- new_array = [new_array];
- this.clear();
- this.push.apply(this, new_array);
- },
- clear: function(){
- this.length = 0;
- },
- copy: function(){
- var a = new DateArray();
- a.replace(this);
- return a;
- }
- };
-
- return function(){
- var a = [];
- a.push.apply(a, arguments);
- $.extend(a, extras);
- return a;
- };
- })();
-
-
- // Picker object
-
- var Datepicker = function(element, options){
- $.data(element, 'datepicker', this);
-
- this._events = [];
- this._secondaryEvents = [];
-
- this._process_options(options);
-
- this.dates = new DateArray();
- this.viewDate = this.o.defaultViewDate;
- this.focusDate = null;
-
- this.element = $(element);
- this.isInput = this.element.is('input');
- this.inputField = this.isInput ? this.element : this.element.find('input');
- this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn') : false;
- if (this.component && this.component.length === 0)
- this.component = false;
- this.isInline = !this.component && this.element.is('div');
-
- this.picker = $(DPGlobal.template);
-
- // Checking templates and inserting
- if (this._check_template(this.o.templates.leftArrow)) {
- this.picker.find('.prev').html(this.o.templates.leftArrow);
- }
-
- if (this._check_template(this.o.templates.rightArrow)) {
- this.picker.find('.next').html(this.o.templates.rightArrow);
- }
-
- this._buildEvents();
- this._attachEvents();
-
- if (this.isInline){
- this.picker.addClass('datepicker-inline').appendTo(this.element);
- }
- else {
- this.picker.addClass('datepicker-dropdown dropdown-menu');
- }
-
- if (this.o.rtl){
- this.picker.addClass('datepicker-rtl');
- }
-
- if (this.o.calendarWeeks) {
- this.picker.find('.datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear')
- .attr('colspan', function(i, val){
- return Number(val) + 1;
- });
- }
-
- this._process_options({
- startDate: this._o.startDate,
- endDate: this._o.endDate,
- daysOfWeekDisabled: this.o.daysOfWeekDisabled,
- daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,
- datesDisabled: this.o.datesDisabled
- });
-
- this._allow_update = false;
- this.setViewMode(this.o.startView);
- this._allow_update = true;
-
- this.fillDow();
- this.fillMonths();
- this.update();
+ if (this.o.isInline === null){
+ this.isInline = !this.component && !this.isInput;
+ } else {
+ this.isInline = this.o.isInline;
+ }
+
+ this.picker = $(DPGlobal.template);
+
+ // Checking templates and inserting
+ if (this._check_template(this.o.templates.leftArrow)) {
+ this.picker.find('.prev').html(this.o.templates.leftArrow);
+ }
+
+ if (this._check_template(this.o.templates.rightArrow)) {
+ this.picker.find('.next').html(this.o.templates.rightArrow);
+ }
+
+ this._buildEvents();
+ this._attachEvents();
+
+ if (this.isInline){
+ this.picker.addClass('datepicker-inline').appendTo(this.element);
+ }
+ else {
+ this.picker.addClass('datepicker-dropdown dropdown-menu');
+ }
+
+ if (this.o.rtl){
+ this.picker.addClass('datepicker-rtl');
+ }
+
+ if (this.o.calendarWeeks) {
+ this.picker.find('.datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear')
+ .attr('colspan', function(i, val){
+ return Number(val) + 1;
+ });
+ }
+
+ this._process_options({
+ startDate: this._o.startDate,
+ endDate: this._o.endDate,
+ daysOfWeekDisabled: this.o.daysOfWeekDisabled,
+ daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,
+ datesDisabled: this.o.datesDisabled
+ });
+
+ this._allow_update = false;
+ this.setViewMode(this.o.startView);
+ this._allow_update = true;
+
+ this.fillDow();
+ this.fillMonths();
+
+ this.update();
+
+ if (this.isInline){
+ this.show();
+ }
+ };
+
+ Datepicker.prototype = {
+ constructor: Datepicker,
+
+ _resolveViewName: function(view){
+ $.each(DPGlobal.viewModes, function(i, viewMode){
+ if (view === i || $.inArray(view, viewMode.names) !== -1){
+ view = i;
+ return false;
+ }
+ });
+
+ return view;
+ },
+
+ _resolveDaysOfWeek: function(daysOfWeek){
+ if (!Array.isArray(daysOfWeek))
+ daysOfWeek = daysOfWeek.split(/[,\s]*/);
+ return $.map(daysOfWeek, Number);
+ },
+
+ _check_template: function(tmp){
+ try {
+ // If empty
+ if (tmp === undefined || tmp === "") {
+ return false;
+ }
+ // If no html, everything ok
+ if ((tmp.match(/[<>]/g) || []).length <= 0) {
+ return true;
+ }
+ // Checking if html is fine
+ var jDom = $(tmp);
+ return jDom.length > 0;
+ }
+ catch (ex) {
+ return false;
+ }
+ },
+
+ _process_options: function(opts){
+ // Store raw options for reference
+ this._o = $.extend({}, this._o, opts);
+ // Processed options
+ var o = this.o = $.extend({}, this._o);
+
+ // Check if "de-DE" style date is available, if not language should
+ // fallback to 2 letter code eg "de"
+ var lang = o.language;
+ if (!dates[lang]){
+ lang = lang.split('-')[0];
+ if (!dates[lang])
+ lang = defaults.language;
+ }
+ o.language = lang;
+
+ // Retrieve view index from any aliases
+ o.startView = this._resolveViewName(o.startView);
+ o.minViewMode = this._resolveViewName(o.minViewMode);
+ o.maxViewMode = this._resolveViewName(o.maxViewMode);
+
+ // Check view is between min and max
+ o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView));
+
+ // true, false, or Number > 0
+ if (o.multidate !== true){
+ o.multidate = Number(o.multidate) || false;
+ if (o.multidate !== false)
+ o.multidate = Math.max(0, o.multidate);
+ }
+ o.multidateSeparator = String(o.multidateSeparator);
+
+ o.weekStart %= 7;
+ o.weekEnd = (o.weekStart + 6) % 7;
+
+ var format = DPGlobal.parseFormat(o.format);
+ if (o.startDate !== -Infinity){
+ if (!!o.startDate){
+ if (o.startDate instanceof Date)
+ o.startDate = this._local_to_utc(this._zero_time(o.startDate));
+ else
+ o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear);
+ }
+ else {
+ o.startDate = -Infinity;
+ }
+ }
+ if (o.endDate !== Infinity){
+ if (!!o.endDate){
+ if (o.endDate instanceof Date)
+ o.endDate = this._local_to_utc(this._zero_time(o.endDate));
+ else
+ o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear);
+ }
+ else {
+ o.endDate = Infinity;
+ }
+ }
+
+ o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]);
+ o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);
+
+ o.datesDisabled = o.datesDisabled||[];
+ if (!Array.isArray(o.datesDisabled)) {
+ o.datesDisabled = o.datesDisabled.split(',');
+ }
+ o.datesDisabled = $.map(o.datesDisabled, function(d){
+ return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);
+ });
+
+ var plc = String(o.orientation).toLowerCase().split(/\s+/g),
+ _plc = o.orientation.toLowerCase();
+ plc = $.grep(plc, function(word){
+ return /^auto|left|right|top|bottom$/.test(word);
+ });
+ o.orientation = {x: 'auto', y: 'auto'};
+ if (!_plc || _plc === 'auto')
+ ; // no action
+ else if (plc.length === 1){
+ switch (plc[0]){
+ case 'top':
+ case 'bottom':
+ o.orientation.y = plc[0];
+ break;
+ case 'left':
+ case 'right':
+ o.orientation.x = plc[0];
+ break;
+ }
+ }
+ else {
+ _plc = $.grep(plc, function(word){
+ return /^left|right$/.test(word);
+ });
+ o.orientation.x = _plc[0] || 'auto';
+
+ _plc = $.grep(plc, function(word){
+ return /^top|bottom$/.test(word);
+ });
+ o.orientation.y = _plc[0] || 'auto';
+ }
+ if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') {
+ o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear);
+ } else if (o.defaultViewDate) {
+ var year = o.defaultViewDate.year || new Date().getFullYear();
+ var month = o.defaultViewDate.month || 0;
+ var day = o.defaultViewDate.day || 1;
+ o.defaultViewDate = UTCDate(year, month, day);
+ } else {
+ o.defaultViewDate = UTCToday();
+ }
+ },
+ _applyEvents: function(evs){
+ for (var i=0, el, ch, ev; i < evs.length; i++){
+ el = evs[i][0];
+ if (evs[i].length === 2){
+ ch = undefined;
+ ev = evs[i][1];
+ } else if (evs[i].length === 3){
+ ch = evs[i][1];
+ ev = evs[i][2];
+ }
+ el.on(ev, ch);
+ }
+ },
+ _unapplyEvents: function(evs){
+ for (var i=0, el, ev, ch; i < evs.length; i++){
+ el = evs[i][0];
+ if (evs[i].length === 2){
+ ch = undefined;
+ ev = evs[i][1];
+ } else if (evs[i].length === 3){
+ ch = evs[i][1];
+ ev = evs[i][2];
+ }
+ el.off(ev, ch);
+ }
+ },
+ _buildEvents: function(){
+ var events = {
+ keyup: $.proxy(function(e){
+ if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
+ this.update();
+ }, this),
+ keydown: $.proxy(this.keydown, this),
+ paste: $.proxy(this.paste, this)
+ };
- if (this.isInline){
- this.show();
- }
- };
+ if (this.o.showOnFocus === true) {
+ events.focus = $.proxy(this.show, this);
+ }
- Datepicker.prototype = {
- constructor: Datepicker,
-
- _resolveViewName: function(view){
- $.each(DPGlobal.viewModes, function(i, viewMode){
- if (view === i || $.inArray(view, viewMode.names) !== -1){
- view = i;
- return false;
- }
- });
-
- return view;
- },
-
- _resolveDaysOfWeek: function(daysOfWeek){
- if (!$.isArray(daysOfWeek))
- daysOfWeek = daysOfWeek.split(/[,\s]*/);
- return $.map(daysOfWeek, Number);
- },
-
- _check_template: function(tmp){
- try {
- // If empty
- if (tmp === undefined || tmp === "") {
- return false;
- }
- // If no html, everything ok
- if ((tmp.match(/[<>]/g) || []).length <= 0) {
- return true;
- }
- // Checking if html is fine
- var jDom = $(tmp);
- return jDom.length > 0;
- }
- catch (ex) {
- return false;
- }
- },
-
- _process_options: function(opts){
- // Store raw options for reference
- this._o = $.extend({}, this._o, opts);
- // Processed options
- var o = this.o = $.extend({}, this._o);
-
- // Check if "de-DE" style date is available, if not language should
- // fallback to 2 letter code eg "de"
- var lang = o.language;
- if (!dates[lang]){
- lang = lang.split('-')[0];
- if (!dates[lang])
- lang = defaults.language;
- }
- o.language = lang;
-
- // Retrieve view index from any aliases
- o.startView = this._resolveViewName(o.startView);
- o.minViewMode = this._resolveViewName(o.minViewMode);
- o.maxViewMode = this._resolveViewName(o.maxViewMode);
-
- // Check view is between min and max
- o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView));
-
- // true, false, or Number > 0
- if (o.multidate !== true){
- o.multidate = Number(o.multidate) || false;
- if (o.multidate !== false)
- o.multidate = Math.max(0, o.multidate);
- }
- o.multidateSeparator = String(o.multidateSeparator);
-
- o.weekStart %= 7;
- o.weekEnd = (o.weekStart + 6) % 7;
-
- var format = DPGlobal.parseFormat(o.format);
- if (o.startDate !== -Infinity){
- if (!!o.startDate){
- if (o.startDate instanceof Date)
- o.startDate = this._local_to_utc(this._zero_time(o.startDate));
- else
- o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear);
- }
- else {
- o.startDate = -Infinity;
- }
- }
- if (o.endDate !== Infinity){
- if (!!o.endDate){
- if (o.endDate instanceof Date)
- o.endDate = this._local_to_utc(this._zero_time(o.endDate));
- else
- o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear);
- }
- else {
- o.endDate = Infinity;
- }
- }
-
- o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]);
- o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);
-
- o.datesDisabled = o.datesDisabled||[];
- if (!$.isArray(o.datesDisabled)) {
- o.datesDisabled = o.datesDisabled.split(',');
- }
- o.datesDisabled = $.map(o.datesDisabled, function(d){
- return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);
- });
-
- var plc = String(o.orientation).toLowerCase().split(/\s+/g),
- _plc = o.orientation.toLowerCase();
- plc = $.grep(plc, function(word){
- return /^auto|left|right|top|bottom$/.test(word);
- });
- o.orientation = {x: 'auto', y: 'auto'};
- if (!_plc || _plc === 'auto')
- ; // no action
- else if (plc.length === 1){
- switch (plc[0]){
- case 'top':
- case 'bottom':
- o.orientation.y = plc[0];
- break;
- case 'left':
- case 'right':
- o.orientation.x = plc[0];
- break;
- }
- }
- else {
- _plc = $.grep(plc, function(word){
- return /^left|right$/.test(word);
- });
- o.orientation.x = _plc[0] || 'auto';
-
- _plc = $.grep(plc, function(word){
- return /^top|bottom$/.test(word);
- });
- o.orientation.y = _plc[0] || 'auto';
- }
- if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') {
- o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear);
- } else if (o.defaultViewDate) {
- var year = o.defaultViewDate.year || new Date().getFullYear();
- var month = o.defaultViewDate.month || 0;
- var day = o.defaultViewDate.day || 1;
- o.defaultViewDate = UTCDate(year, month, day);
- } else {
- o.defaultViewDate = UTCToday();
- }
- },
- _applyEvents: function(evs){
- for (var i=0, el, ch, ev; i < evs.length; i++){
- el = evs[i][0];
- if (evs[i].length === 2){
- ch = undefined;
- ev = evs[i][1];
- } else if (evs[i].length === 3){
- ch = evs[i][1];
- ev = evs[i][2];
- }
- el.on(ev, ch);
- }
- },
- _unapplyEvents: function(evs){
- for (var i=0, el, ev, ch; i < evs.length; i++){
- el = evs[i][0];
- if (evs[i].length === 2){
- ch = undefined;
- ev = evs[i][1];
- } else if (evs[i].length === 3){
- ch = evs[i][1];
- ev = evs[i][2];
- }
- el.off(ev, ch);
- }
- },
- _buildEvents: function(){
- var events = {
- keyup: $.proxy(function(e){
- if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
- this.update();
- }, this),
- keydown: $.proxy(this.keydown, this),
- paste: $.proxy(this.paste, this)
- };
-
- if (this.o.showOnFocus === true) {
- events.focus = $.proxy(this.show, this);
- }
-
- if (this.isInput) { // single input
- this._events = [
- [this.element, events]
- ];
- }
- // component: input + button
- else if (this.component && this.inputField.length) {
- this._events = [
- // For components that are not readonly, allow keyboard nav
- [this.inputField, events],
- [this.component, {
- click: $.proxy(this.show, this)
- }]
- ];
- }
- else {
- this._events = [
- [this.element, {
- click: $.proxy(this.show, this),
- keydown: $.proxy(this.keydown, this)
- }]
- ];
- }
- this._events.push(
- // Component: listen for blur on element descendants
- [this.element, '*', {
- blur: $.proxy(function(e){
- this._focused_from = e.target;
- }, this)
- }],
- // Input: listen for blur on element
- [this.element, {
- blur: $.proxy(function(e){
- this._focused_from = e.target;
- }, this)
- }]
- );
-
- if (this.o.immediateUpdates) {
- // Trigger input updates immediately on changed year/month
- this._events.push([this.element, {
- 'changeYear changeMonth': $.proxy(function(e){
- this.update(e.date);
- }, this)
- }]);
- }
-
- this._secondaryEvents = [
- [this.picker, {
- click: $.proxy(this.click, this)
- }],
- [this.picker, '.prev, .next', {
- click: $.proxy(this.navArrowsClick, this)
- }],
- [this.picker, '.day:not(.disabled)', {
- click: $.proxy(this.dayCellClick, this)
- }],
- [$(window), {
- resize: $.proxy(this.place, this)
- }],
- [$(document), {
- 'mousedown touchstart': $.proxy(function(e){
- // Clicked outside the datepicker, hide it
- if (!(
- this.element.is(e.target) ||
- this.element.find(e.target).length ||
- this.picker.is(e.target) ||
- this.picker.find(e.target).length ||
- this.isInline
- )){
- this.hide();
- }
- }, this)
- }]
- ];
- },
- _attachEvents: function(){
- this._detachEvents();
- this._applyEvents(this._events);
- },
- _detachEvents: function(){
- this._unapplyEvents(this._events);
- },
- _attachSecondaryEvents: function(){
- this._detachSecondaryEvents();
- this._applyEvents(this._secondaryEvents);
- },
- _detachSecondaryEvents: function(){
- this._unapplyEvents(this._secondaryEvents);
- },
- _trigger: function(event, altdate){
- var date = altdate || this.dates.get(-1),
- local_date = this._utc_to_local(date);
-
- this.element.trigger({
- type: event,
- date: local_date,
- viewMode: this.viewMode,
- dates: $.map(this.dates, this._utc_to_local),
- format: $.proxy(function(ix, format){
- if (arguments.length === 0){
- ix = this.dates.length - 1;
- format = this.o.format;
- } else if (typeof ix === 'string'){
- format = ix;
- ix = this.dates.length - 1;
- }
- format = format || this.o.format;
- var date = this.dates.get(ix);
- return DPGlobal.formatDate(date, format, this.o.language);
- }, this)
- });
- },
-
- show: function(){
- if (this.inputField.is(':disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false))
- return;
- if (!this.isInline)
- this.picker.appendTo(this.o.container);
- this.place();
- this.picker.show();
- this._attachSecondaryEvents();
- this._trigger('show');
- if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) {
- $(this.element).blur();
- }
- return this;
- },
-
- hide: function(){
- if (this.isInline || !this.picker.is(':visible'))
- return this;
- this.focusDate = null;
- this.picker.hide().detach();
- this._detachSecondaryEvents();
- this.setViewMode(this.o.startView);
-
- if (this.o.forceParse && this.inputField.val())
- this.setValue();
- this._trigger('hide');
- return this;
- },
-
- destroy: function(){
+ if (this.isInput) { // single input
+ this._events = [
+ [this.element, events]
+ ];
+ }
+ // component: input + button
+ else if (this.component && this.inputField.length) {
+ this._events = [
+ // For components that are not readonly, allow keyboard nav
+ [this.inputField, events],
+ [this.component, {
+ click: $.proxy(this.show, this)
+ }]
+ ];
+ }
+ else {
+ this._events = [
+ [this.element, {
+ click: $.proxy(this.show, this),
+ keydown: $.proxy(this.keydown, this)
+ }]
+ ];
+ }
+ this._events.push(
+ // Component: listen for blur on element descendants
+ [this.element, '*', {
+ blur: $.proxy(function(e){
+ this._focused_from = e.target;
+ }, this)
+ }],
+ // Input: listen for blur on element
+ [this.element, {
+ blur: $.proxy(function(e){
+ this._focused_from = e.target;
+ }, this)
+ }]
+ );
+
+ if (this.o.immediateUpdates) {
+ // Trigger input updates immediately on changed year/month
+ this._events.push([this.element, {
+ 'changeYear changeMonth': $.proxy(function(e){
+ this.update(e.date);
+ }, this)
+ }]);
+ }
+
+ this._secondaryEvents = [
+ [this.picker, {
+ click: $.proxy(this.click, this)
+ }],
+ [this.picker, '.prev, .next', {
+ click: $.proxy(this.navArrowsClick, this)
+ }],
+ [this.picker, '.day:not(.disabled)', {
+ click: $.proxy(this.dayCellClick, this)
+ }],
+ [$(window), {
+ resize: $.proxy(this.place, this)
+ }],
+ [$(document), {
+ 'mousedown touchstart': $.proxy(function(e){
+ // Clicked outside the datepicker, hide it
+ if (!(
+ this.element.is(e.target) ||
+ this.element.find(e.target).length ||
+ this.picker.is(e.target) ||
+ this.picker.find(e.target).length ||
+ this.isInline
+ )){
this.hide();
- this._detachEvents();
- this._detachSecondaryEvents();
- this.picker.remove();
- delete this.element.data().datepicker;
- if (!this.isInput){
- delete this.element.data().date;
- }
- return this;
- },
-
- paste: function(e){
- var dateString;
- if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types
- && $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) {
- dateString = e.originalEvent.clipboardData.getData('text/plain');
- } else if (window.clipboardData) {
- dateString = window.clipboardData.getData('Text');
- } else {
- return;
- }
- this.setDate(dateString);
- this.update();
- e.preventDefault();
- },
-
- _utc_to_local: function(utc){
- if (!utc) {
- return utc;
- }
-
- var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
-
- if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) {
- local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000));
- }
-
- return local;
- },
- _local_to_utc: function(local){
- return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
- },
- _zero_time: function(local){
- return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
- },
- _zero_utc_time: function(utc){
- return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate());
- },
-
- getDates: function(){
- return $.map(this.dates, this._utc_to_local);
- },
-
- getUTCDates: function(){
- return $.map(this.dates, function(d){
- return new Date(d);
- });
- },
-
- getDate: function(){
- return this._utc_to_local(this.getUTCDate());
- },
-
- getUTCDate: function(){
- var selected_date = this.dates.get(-1);
- if (selected_date !== undefined) {
- return new Date(selected_date);
- } else {
- return null;
- }
- },
-
- clearDates: function(){
- this.inputField.val('');
- this.update();
- this._trigger('changeDate');
-
- if (this.o.autoclose) {
- this.hide();
- }
- },
-
- setDates: function(){
- var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
- this.update.apply(this, args);
- this._trigger('changeDate');
- this.setValue();
- return this;
- },
-
- setUTCDates: function(){
- var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
- this.setDates.apply(this, $.map(args, this._utc_to_local));
- return this;
- },
-
- setDate: alias('setDates'),
- setUTCDate: alias('setUTCDates'),
- remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'),
-
- setValue: function(){
- var formatted = this.getFormattedDate();
- this.inputField.val(formatted);
- return this;
- },
-
- getFormattedDate: function(format){
- if (format === undefined)
- format = this.o.format;
-
- var lang = this.o.language;
- return $.map(this.dates, function(d){
- return DPGlobal.formatDate(d, format, lang);
- }).join(this.o.multidateSeparator);
- },
-
- getStartDate: function(){
- return this.o.startDate;
- },
-
- setStartDate: function(startDate){
- this._process_options({startDate: startDate});
- this.update();
- this.updateNavArrows();
- return this;
- },
-
- getEndDate: function(){
- return this.o.endDate;
- },
-
- setEndDate: function(endDate){
- this._process_options({endDate: endDate});
- this.update();
- this.updateNavArrows();
- return this;
- },
-
- setDaysOfWeekDisabled: function(daysOfWeekDisabled){
- this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
- this.update();
- return this;
- },
-
- setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){
- this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted});
- this.update();
- return this;
- },
-
- setDatesDisabled: function(datesDisabled){
- this._process_options({datesDisabled: datesDisabled});
- this.update();
- return this;
- },
-
- place: function(){
- if (this.isInline)
- return this;
- var calendarWidth = this.picker.outerWidth(),
- calendarHeight = this.picker.outerHeight(),
- inputHeight = this.inputField.innerHeight(),
- visualPadding = 10,
- container = $(this.o.container),
- windowWidth = container.width(),
- windowHeight = container.height(),
- scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(),
- scrollHeight = container[0].scrollHeight,
- clientHeight = this.o.container === 'body' ? window.innerHeight : container[0].clientHeight,
- scrollMoveMax = scrollHeight - clientHeight,
- appendOffset = container.offset();
-
- var parentsZindex = [0];
- this.element.parents().each(function(){
- var itemZIndex = $(this).css('z-index');
- if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex));
- });
- var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset;
- var offset = this.component ? this.component.parent().offset() : this.element.offset();
- var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
- var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
- var left = offset.left - appendOffset.left;
- var top = offset.top - appendOffset.top;
-
- if (this.o.container !== 'body') {
- top += scrollTop;
- }
-
- this.picker.removeClass(
- 'datepicker-orient-top datepicker-orient-bottom '+
- 'datepicker-orient-right datepicker-orient-left'
- );
-
- if (this.o.orientation.x !== 'auto'){
- this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
- if (this.o.orientation.x === 'right')
- left -= calendarWidth - width;
- }
- // auto x orientation is best-placement: if it crosses a window
- // edge, fudge it sideways
- else {
- if (offset.left < 0) {
- // component is outside the window on the left side. Move it into visible range
- this.picker.addClass('datepicker-orient-left');
- left -= offset.left - visualPadding;
- } else if (left + calendarWidth > windowWidth) {
- // the calendar passes the widow right edge. Align it to component right side
- this.picker.addClass('datepicker-orient-right');
- left += width - calendarWidth;
- } else {
- if (this.o.rtl) {
- // Default to right
- this.picker.addClass('datepicker-orient-right');
- } else {
- // Default to left
- this.picker.addClass('datepicker-orient-left');
- }
- }
- }
-
- // auto y orientation is best-situation: top or bottom, no fudging,
- // decision based on which shows more of the calendar
- var yorient = this.o.orientation.y,
- bottom_overflow, top_overflow;
-
- if (yorient === 'auto'){
-
- bottom_overflow = (windowHeight-top) - inputHeight - calendarHeight + (scrollMoveMax-scrollTop);
- top_overflow = -scrollTop + top - calendarHeight;
-
- yorient = 'bottom';
-
- if(bottom_overflow < 0){
- yorient = 'top';
-
- if(top_overflow < 0){
- yorient = 'bottom';
- }
- }
- }
-
- this.picker.addClass('datepicker-orient-' + yorient);
- if (yorient === 'top')
- top -= calendarHeight + parseInt(this.picker.css('padding-top'));
- else
- top += height;
-
- if (this.o.rtl) {
- var right = windowWidth - (left + width);
- this.picker.css({
- top: top,
- right: right,
- zIndex: zIndex
- });
- } else {
- this.picker.css({
- top: top,
- left: left,
- zIndex: zIndex
- });
- }
-
- //
- var styleAttr = this.picker.attr('style');
- var ziStart = styleAttr.substring(styleAttr.indexOf("z-index"));
- var semicolonIdx = ziStart.indexOf(";");
- if(semicolonIdx != -1){
- ziString = ziStart.substring(0,semicolonIdx);
- } else {
- ziString = ziStart;
- }
-
- if(ziString.indexOf("!important") == -1){
- var ziValue = ziString.substring(9);
- var replaceStr = "z-index: " + ziValue + ' !important';
- this.picker.attr('style', styleAttr.replace(ziString, replaceStr));
- }
-
- return this;
- },
-
- _allow_update: true,
- update: function(){
- if (!this._allow_update)
- return this;
-
- var oldDates = this.dates.copy(),
- dates = [],
- fromArgs = false;
- if (arguments.length){
- $.each(arguments, $.proxy(function(i, date){
- if (date instanceof Date)
- date = this._local_to_utc(date);
- dates.push(date);
- }, this));
- fromArgs = true;
- } else {
- dates = this.isInput
- ? this.element.val()
- : this.element.data('date') || this.inputField.val();
- if (dates && this.o.multidate)
- dates = dates.split(this.o.multidateSeparator);
- else
- dates = [dates];
- delete this.element.data().date;
- }
-
- dates = $.map(dates, $.proxy(function(date){
- return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear);
- }, this));
- dates = $.grep(dates, $.proxy(function(date){
- return (
- !this.dateWithinRange(date) ||
- !date
- );
- }, this), true);
- this.dates.replace(dates);
-
- if (this.o.updateViewDate) {
- if (this.dates.length)
- this.viewDate = new Date(this.dates.get(-1));
- else if (this.viewDate < this.o.startDate)
- this.viewDate = new Date(this.o.startDate);
- else if (this.viewDate > this.o.endDate)
- this.viewDate = new Date(this.o.endDate);
- else
- this.viewDate = this.o.defaultViewDate;
- }
-
- if (fromArgs){
- // setting date by clicking
- this.setValue();
- this.element.change();
- }
- else if (this.dates.length){
- // setting date by typing
- if (String(oldDates) !== String(this.dates) && fromArgs) {
- this._trigger('changeDate');
- this.element.change();
- }
- }
- if (!this.dates.length && oldDates.length) {
- this._trigger('clearDate');
- this.element.change();
- }
-
- this.fill();
- return this;
- },
-
- fillDow: function(){
- if (this.o.showWeekDays) {
- var dowCnt = this.o.weekStart,
- html = '
';
- if (this.o.calendarWeeks){
- html += '
';
- }
- while (dowCnt < this.o.weekStart + 7){
- html += '
'+dates[this.o.language].daysMin[(dowCnt++)%7]+'
';
- }
- html += '
';
- this.picker.find('.datepicker-days thead').append(html);
- }
- },
-
- fillMonths: function(){
- var localDate = this._utc_to_local(this.viewDate);
- var html = '';
- var focused;
- for (var i = 0; i < 12; i++){
- focused = localDate && localDate.getMonth() === i ? ' focused' : '';
- html += '' + dates[this.o.language].monthsShort[i] + '';
- }
- this.picker.find('.datepicker-months td').html(html);
- },
-
- setRange: function(range){
- if (!range || !range.length)
- delete this.range;
- else
- this.range = $.map(range, function(d){
- return d.valueOf();
- });
- this.fill();
- },
-
- getClassNames: function(date){
- var cls = [],
- year = this.viewDate.getUTCFullYear(),
- month = this.viewDate.getUTCMonth(),
- today = UTCToday();
- if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
- cls.push('old');
- } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
- cls.push('new');
- }
- if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
- cls.push('focused');
- // Compare internal UTC date with UTC today, not local today
- if (this.o.todayHighlight && isUTCEquals(date, today)) {
- cls.push('today');
- }
- if (this.dates.contains(date) !== -1)
- cls.push('active');
- if (!this.dateWithinRange(date)){
- cls.push('disabled');
- }
- if (this.dateIsDisabled(date)){
- cls.push('disabled', 'disabled-date');
- }
- if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){
- cls.push('highlighted');
- }
-
- if (this.range){
- if (date > this.range[0] && date < this.range[this.range.length-1]){
- cls.push('range');
- }
- if ($.inArray(date.valueOf(), this.range) !== -1){
- cls.push('selected');
- }
- if (date.valueOf() === this.range[0]){
- cls.push('range-start');
- }
- if (date.valueOf() === this.range[this.range.length-1]){
- cls.push('range-end');
- }
- }
- return cls;
- },
-
- _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){
- var html = '';
- var step = factor / 10;
- var view = this.picker.find(selector);
- var startVal = Math.floor(year / factor) * factor;
- var endVal = startVal + step * 9;
- var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step;
- var selected = $.map(this.dates, function(d){
- return Math.floor(d.getUTCFullYear() / step) * step;
- });
-
- var classes, tooltip, before;
- for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) {
- classes = [cssClass];
- tooltip = null;
-
- if (currVal === startVal - step) {
- classes.push('old');
- } else if (currVal === endVal + step) {
- classes.push('new');
- }
- if ($.inArray(currVal, selected) !== -1) {
- classes.push('active');
- }
- if (currVal < startYear || currVal > endYear) {
- classes.push('disabled');
- }
- if (currVal === focusedVal) {
- classes.push('focused');
- }
-
- if (beforeFn !== $.noop) {
- before = beforeFn(new Date(currVal, 0, 1));
- if (before === undefined) {
- before = {};
- } else if (typeof before === 'boolean') {
- before = {enabled: before};
- } else if (typeof before === 'string') {
- before = {classes: before};
- }
- if (before.enabled === false) {
- classes.push('disabled');
- }
- if (before.classes) {
- classes = classes.concat(before.classes.split(/\s+/));
- }
- if (before.tooltip) {
- tooltip = before.tooltip;
- }
- }
-
- html += '' + currVal + '';
- }
-
- view.find('.datepicker-switch').text(startVal + '-' + endVal);
- view.find('td').html(html);
- },
-
- fill: function(){
- var d = new Date(this.viewDate),
- year = d.getUTCFullYear(),
- month = d.getUTCMonth(),
- startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
- startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
- endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
- endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
- todaytxt = dates[this.o.language].today || dates['ko'].today || '',
- cleartxt = dates[this.o.language].clear || dates['ko'].clear || '',
- titleFormat = dates[this.o.language].titleFormat || dates['ko'].titleFormat,
- todayDate = UTCToday(),
- titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate),
- tooltip,
- before;
- if (isNaN(year) || isNaN(month))
- return;
- this.picker.find('.datepicker-days .datepicker-switch')
- .text(DPGlobal.formatDate(d, titleFormat, this.o.language));
- this.picker.find('tfoot .today')
- .text(todaytxt)
- .css('display', titleBtnVisible ? 'table-cell' : 'none');
- this.picker.find('tfoot .clear')
- .text(cleartxt)
- .css('display', this.o.clearBtn === true ? 'table-cell' : 'none');
- this.picker.find('thead .datepicker-title')
- .text(this.o.title)
- .css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none');
- this.updateNavArrows();
- this.fillMonths();
- var prevMonth = UTCDate(year, month, 0),
- day = prevMonth.getUTCDate();
- prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
- var nextMonth = new Date(prevMonth);
- if (prevMonth.getUTCFullYear() < 100){
- nextMonth.setUTCFullYear(prevMonth.getUTCFullYear());
- }
- nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
- nextMonth = nextMonth.valueOf();
- var html = [];
- var weekDay, clsName;
- while (prevMonth.valueOf() < nextMonth){
- weekDay = prevMonth.getUTCDay();
- if (weekDay === this.o.weekStart){
- html.push('
');
- if (this.o.calendarWeeks){
- // ISO 8601: First week contains first thursday.
- // ISO also states week starts on Monday, but we can be more abstract here.
- var
- // Start of current week: based on weekstart/current date
- ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5),
- // Thursday of this week
- th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
- // First Thursday of year, year from thursday
- yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),
- // Calendar week: ms between thursdays, div ms per day, div 7 days
- calWeek = (th - yth) / 864e5 / 7 + 1;
- html.push('
'+ calWeek +'
');
- }
- }
- clsName = this.getClassNames(prevMonth);
- clsName.push('day');
-
- var content = prevMonth.getUTCDate();
-
- if (this.o.beforeShowDay !== $.noop){
- before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
- if (before === undefined)
- before = {};
- else if (typeof before === 'boolean')
- before = {enabled: before};
- else if (typeof before === 'string')
- before = {classes: before};
- if (before.enabled === false)
- clsName.push('disabled');
- if (before.classes)
- clsName = clsName.concat(before.classes.split(/\s+/));
- if (before.tooltip)
- tooltip = before.tooltip;
- if (before.content)
- content = before.content;
- }
-
- //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)
- //Fallback to unique function for older jquery versions
- if ($.isFunction($.uniqueSort)) {
- clsName = $.uniqueSort(clsName);
- } else {
- clsName = $.unique(clsName);
- }
-
- html.push('
');
+ if (this.o.calendarWeeks){
+ // ISO 8601: First week contains first thursday.
+ // ISO also states week starts on Monday, but we can be more abstract here.
+ var
+ // Start of current week: based on weekstart/current date
+ ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5),
+ // Thursday of this week
+ th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
+ // First Thursday of year, year from thursday
+ yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),
+ // Calendar week: ms between thursdays, div ms per day, div 7 days
+ calWeek = (th - yth) / 864e5 / 7 + 1;
+ html.push('
'+ calWeek +'
');
+ }
+ }
+ clsName = this.getClassNames(prevMonth);
+ clsName.push('day');
+
+ var content = prevMonth.getUTCDate();
+
+ if (this.o.beforeShowDay !== $.noop){
+ before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
+ if (before === undefined)
+ before = {};
+ else if (typeof before === 'boolean')
+ before = {enabled: before};
+ else if (typeof before === 'string')
+ before = {classes: before};
+ if (before.enabled === false)
+ clsName.push('disabled');
+ if (before.classes)
+ clsName = clsName.concat(before.classes.split(/\s+/));
+ if (before.tooltip)
+ tooltip = before.tooltip;
+ if (before.content)
+ content = before.content;
+ }
+
+ //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)
+ //Fallback to unique function for older jquery versions
+ if (typeof $.uniqueSort === "function") {
+ clsName = $.uniqueSort(clsName);
+ } else {
+ clsName = $.unique(clsName);
+ }
+
+ html.push('