From 75713f49f6d384c673d30febb2b4ca184479032e Mon Sep 17 00:00:00 2001 From: Neha Kadam Date: Tue, 27 Sep 2016 22:54:29 +0530 Subject: [PATCH] Allow Date to be set as min and max values Set Date as minDate, maxDate, minTime, maxTime, minDateTime and maxDateTime value. Previously, only string value in input DateFormat / TimeFormat / DateTimeFormat could be set as minimum and maximum date. --- DateTimePicker.jquery.json | 2 +- bower.json | 2 +- demo/PeriodRange-Both.htm | 9 +- dist/DateTimePicker-ltie9.css | 2 +- dist/DateTimePicker-ltie9.js | 2 +- dist/DateTimePicker-ltie9.min.css | 2 +- dist/DateTimePicker-ltie9.min.js | 2 +- dist/DateTimePicker.css | 2 +- dist/DateTimePicker.js | 305 ++++++++++++++----------- dist/DateTimePicker.min.css | 2 +- dist/DateTimePicker.min.js | 4 +- dist/DateTimePicker_iOS_fix.js | 2 +- dist/i18n/DateTimePicker-i18n-cs.js | 2 +- dist/i18n/DateTimePicker-i18n-de.js | 2 +- dist/i18n/DateTimePicker-i18n-en.js | 2 +- dist/i18n/DateTimePicker-i18n-es.js | 2 +- dist/i18n/DateTimePicker-i18n-fr.js | 2 +- dist/i18n/DateTimePicker-i18n-it.js | 2 +- dist/i18n/DateTimePicker-i18n-ja.js | 2 +- dist/i18n/DateTimePicker-i18n-nb.js | 2 +- dist/i18n/DateTimePicker-i18n-nl.js | 2 +- dist/i18n/DateTimePicker-i18n-ro.js | 2 +- dist/i18n/DateTimePicker-i18n-ru.js | 2 +- dist/i18n/DateTimePicker-i18n-uk.js | 2 +- dist/i18n/DateTimePicker-i18n-zh-TW.js | 2 +- dist/i18n/DateTimePicker-i18n.js | 2 +- dist/i18n/DatetimePicker-i18n-zh-CN.js | 2 +- package.json | 2 +- src/DateTimePicker-ltie9.css | 2 +- src/DateTimePicker-ltie9.js | 2 +- src/DateTimePicker.css | 2 +- src/DateTimePicker.js | 305 ++++++++++++++----------- src/DateTimePicker_iOS_fix.js | 2 +- src/i18n/DateTimePicker-i18n-cs.js | 2 +- src/i18n/DateTimePicker-i18n-de.js | 2 +- src/i18n/DateTimePicker-i18n-en.js | 2 +- src/i18n/DateTimePicker-i18n-es.js | 2 +- src/i18n/DateTimePicker-i18n-fr.js | 2 +- src/i18n/DateTimePicker-i18n-it.js | 2 +- src/i18n/DateTimePicker-i18n-ja.js | 2 +- src/i18n/DateTimePicker-i18n-nb.js | 2 +- src/i18n/DateTimePicker-i18n-nl.js | 2 +- src/i18n/DateTimePicker-i18n-ro.js | 2 +- src/i18n/DateTimePicker-i18n-ru.js | 2 +- src/i18n/DateTimePicker-i18n-uk.js | 2 +- src/i18n/DateTimePicker-i18n-zh-TW.js | 2 +- src/i18n/DateTimePicker-i18n.js | 2 +- src/i18n/DatetimePicker-i18n-zh-CN.js | 2 +- 48 files changed, 403 insertions(+), 308 deletions(-) diff --git a/DateTimePicker.jquery.json b/DateTimePicker.jquery.json index 7eaa7c2..c10718b 100755 --- a/DateTimePicker.jquery.json +++ b/DateTimePicker.jquery.json @@ -29,7 +29,7 @@ "docs": "http://curioussolutions.github.io/DateTimePicker/", - "version": "0.1.33", + "version": "0.1.34", "licenses": [ { diff --git a/bower.json b/bower.json index 170a299..fe38c58 100644 --- a/bower.json +++ b/bower.json @@ -15,7 +15,7 @@ "input" ], - "version": "0.1.33", + "version": "0.1.34", "homepage": "http://curioussolutions.github.io/DateTimePicker/", diff --git a/demo/PeriodRange-Both.htm b/demo/PeriodRange-Both.htm index bdbf0ea..d2cd663 100644 --- a/demo/PeriodRange-Both.htm +++ b/demo/PeriodRange-Both.htm @@ -82,8 +82,13 @@ minTime: "09:00", maxTime: "19:30", - minDateTime: "01-03-2012 08:30", - maxDateTime: "01-03-2016 18:30" + minDateTime: new Date(2016, 2, 1, 8, 30, 0, 0), + maxDateTime: new Date(2016, 2, 1, 18, 30, 0, 0) + + // OR + + // minDateTime: "01-03-2012 08:30", + // maxDateTime: "01-03-2016 18:30" }); }); diff --git a/dist/DateTimePicker-ltie9.css b/dist/DateTimePicker-ltie9.css index 49c7096..318b688 100755 --- a/dist/DateTimePicker-ltie9.css +++ b/dist/DateTimePicker-ltie9.css @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/DateTimePicker-ltie9.js b/dist/DateTimePicker-ltie9.js index b2e4df2..803abc2 100755 --- a/dist/DateTimePicker-ltie9.js +++ b/dist/DateTimePicker-ltie9.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/DateTimePicker-ltie9.min.css b/dist/DateTimePicker-ltie9.min.css index 3bf9988..7fd8384 100644 --- a/dist/DateTimePicker-ltie9.min.css +++ b/dist/DateTimePicker-ltie9.min.css @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/DateTimePicker-ltie9.min.js b/dist/DateTimePicker-ltie9.min.js index 559a6fa..322f48e 100644 --- a/dist/DateTimePicker-ltie9.min.js +++ b/dist/DateTimePicker-ltie9.min.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/DateTimePicker.css b/dist/DateTimePicker.css index 83341be..524a477 100755 --- a/dist/DateTimePicker.css +++ b/dist/DateTimePicker.css @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/DateTimePicker.js b/dist/DateTimePicker.js index 71aa95e..b924b37 100644 --- a/dist/DateTimePicker.js +++ b/dist/DateTimePicker.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker @@ -9,12 +9,16 @@ ----------------------------------------------------------------------------- */ /* Support Object.keys in IE8 */ -if (!Object.keys) { - Object.keys = function(obj) { +if(!Object.keys) +{ + Object.keys = function(obj) + { var keys = []; - for (var i in obj) { - if (obj.hasOwnProperty(i)) { + for (var i in obj) + { + if (obj.hasOwnProperty(i)) + { keys.push(i); } } @@ -1142,7 +1146,7 @@ $.cf = { oDTP.oData.dMinValue = oDTP._parseDateTime(sMin); if($.cf._isValid(sMax)) oDTP.oData.dMaxValue = oDTP._parseDateTime(sMax); - + if(sStartEnd !== "" && ($.cf._compare(sStartEnd, "start") || $.cf._compare(sStartEnd, "end")) && sStartEndElem !== "") { if($(sStartEndElem).length >= 1) @@ -2033,53 +2037,62 @@ $.cf = { if($.cf._isValid(sDate)) { - var sArrDate; - if(oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6]) - sArrDate = sDate.split(oDTP.settings.monthYearSeparator); - else - sArrDate = sDate.split(oDTP.settings.dateSeparator); - - if(oDTP.oData.bArrMatchFormat[0]) // "dd-MM-yyyy" - { - iDate = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[1]) // "MM-dd-yyyy" - { - iMonth = parseInt(sArrDate[0] - 1); - iDate = parseInt(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[2]) // "yyyy-MM-dd" + if(typeof sDate === "string") { - iYear = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iDate = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[3]) // "dd-MMM-yyyy" - { - iDate = parseInt(sArrDate[0]); - iMonth = oDTP._getShortMonthIndex(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[4]) // "MM-yyyy" - { - iDate = 1; - iMonth = parseInt(sArrDate[0]) - 1; - iYear = parseInt(sArrDate[1]); - } - else if(oDTP.oData.bArrMatchFormat[5]) // "MMM yyyy" - { - iDate = 1; - iMonth = oDTP._getShortMonthIndex(sArrDate[0]); - iYear = parseInt(sArrDate[1]); + var sArrDate; + if(oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6]) + sArrDate = sDate.split(oDTP.settings.monthYearSeparator); + else + sArrDate = sDate.split(oDTP.settings.dateSeparator); + + if(oDTP.oData.bArrMatchFormat[0]) // "dd-MM-yyyy" + { + iDate = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[1]) // "MM-dd-yyyy" + { + iMonth = parseInt(sArrDate[0] - 1); + iDate = parseInt(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[2]) // "yyyy-MM-dd" + { + iYear = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iDate = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[3]) // "dd-MMM-yyyy" + { + iDate = parseInt(sArrDate[0]); + iMonth = oDTP._getShortMonthIndex(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[4]) // "MM-yyyy" + { + iDate = 1; + iMonth = parseInt(sArrDate[0]) - 1; + iYear = parseInt(sArrDate[1]); + } + else if(oDTP.oData.bArrMatchFormat[5]) // "MMM yyyy" + { + iDate = 1; + iMonth = oDTP._getShortMonthIndex(sArrDate[0]); + iYear = parseInt(sArrDate[1]); + } + else if(oDTP.oData.bArrMatchFormat[6]) // "MMMM yyyy" + { + iDate = 1; + iMonth = oDTP._getFullMonthIndex(sArrDate[0]); + iYear = parseInt(sArrDate[1]); + } } - else if(oDTP.oData.bArrMatchFormat[6]) // "MMMM yyyy" + else { - iDate = 1; - iMonth = oDTP._getFullMonthIndex(sArrDate[0]); - iYear = parseInt(sArrDate[1]); + iDate = sDate.getDate(); + iMonth = sDate.getMonth(); + iYear = sDate.getFullYear(); } } @@ -2106,30 +2119,44 @@ $.cf = { if($.cf._isValid(sTime)) { - if(oDTP.oData.bIs12Hour) + if(typeof sTime === "string") { - sArrTime = sTime.split(oDTP.settings.timeMeridiemSeparator); - sTime = sArrTime[0]; - sMeridiem = sArrTime[1]; + if(oDTP.oData.bIs12Hour) + { + sArrTime = sTime.split(oDTP.settings.timeMeridiemSeparator); + sTime = sArrTime[0]; + sMeridiem = sArrTime[1]; - if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) - sMeridiem = ""; - } + if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) + sMeridiem = ""; + } - sArrTimeComp = sTime.split(oDTP.settings.timeSeparator); - iHour = parseInt(sArrTimeComp[0]); - iMinutes = parseInt(sArrTimeComp[1]); + sArrTimeComp = sTime.split(oDTP.settings.timeSeparator); + iHour = parseInt(sArrTimeComp[0]); + iMinutes = parseInt(sArrTimeComp[1]); - if(bShowSeconds) - { - iSeconds = parseInt(sArrTimeComp[2]); - iSeconds = oDTP._adjustSeconds(iSeconds); + if(bShowSeconds) + { + iSeconds = parseInt(sArrTimeComp[2]); + iSeconds = oDTP._adjustSeconds(iSeconds); + } + + if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) + iHour = 0; + else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) + iHour += 12; } + else + { + iHour = sTime.getHours(); + iMinutes = sTime.getMinutes(); - if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) - iHour = 0; - else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) - iHour += 12; + if(bShowSeconds) + { + iSeconds = sTime.getSeconds(); + iSeconds = oDTP._adjustSeconds(iSeconds); + } + } } iMinutes = oDTP._adjustMinutes(iMinutes); @@ -2164,77 +2191,95 @@ $.cf = { if($.cf._isValid(sDateTime)) { - sArrDateTime = sDateTime.split(oDTP.settings.dateTimeSeparator); - sArrDate = sArrDateTime[0].split(oDTP.settings.dateSeparator); - - if(oDTP.oData.bArrMatchFormat[0] || // "dd-MM-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[1] || // ""dd-MM-yyyy hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[8] || // "dd-MM-yyyy HH:mm" - oDTP.oData.bArrMatchFormat[9]) // "dd-MM-yyyy hh:mm AA" - { - iDate = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[2] || // "MM-dd-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[3] || // "MM-dd-yyyy hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[10] || // "MM-dd-yyyy HH:mm" - oDTP.oData.bArrMatchFormat[11]) // "MM-dd-yyyy hh:mm AA" - { - iMonth = parseInt(sArrDate[0] - 1); - iDate = parseInt(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[4] || // "yyyy-MM-dd HH:mm:ss" - oDTP.oData.bArrMatchFormat[5] || // "yyyy-MM-dd hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[12] || // "yyyy-MM-dd HH:mm" - oDTP.oData.bArrMatchFormat[13]) // "yyyy-MM-dd hh:mm AA" - { - iYear = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iDate = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[6] || // "dd-MMM-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[7] || // "dd-MMM-yyyy hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[14] || // "dd-MMM-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[15]) // "dd-MMM-yyyy hh:mm:ss AA" - { - iDate = parseInt(sArrDate[0]); - iMonth = oDTP._getShortMonthIndex(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - - sTime = sArrDateTime[1]; - if($.cf._isValid(sTime)) + if(typeof sDateTime === "string") { - if(oDTP.oData.bIs12Hour) + sArrDateTime = sDateTime.split(oDTP.settings.dateTimeSeparator); + sArrDate = sArrDateTime[0].split(oDTP.settings.dateSeparator); + + if(oDTP.oData.bArrMatchFormat[0] || // "dd-MM-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[1] || // ""dd-MM-yyyy hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[8] || // "dd-MM-yyyy HH:mm" + oDTP.oData.bArrMatchFormat[9]) // "dd-MM-yyyy hh:mm AA" { - if($.cf._compare(oDTP.settings.dateTimeSeparator, oDTP.settings.timeMeridiemSeparator) && (sArrDateTime.length === 3)) - sMeridiem = sArrDateTime[2]; - else + iDate = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[2] || // "MM-dd-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[3] || // "MM-dd-yyyy hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[10] || // "MM-dd-yyyy HH:mm" + oDTP.oData.bArrMatchFormat[11]) // "MM-dd-yyyy hh:mm AA" + { + iMonth = parseInt(sArrDate[0] - 1); + iDate = parseInt(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[4] || // "yyyy-MM-dd HH:mm:ss" + oDTP.oData.bArrMatchFormat[5] || // "yyyy-MM-dd hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[12] || // "yyyy-MM-dd HH:mm" + oDTP.oData.bArrMatchFormat[13]) // "yyyy-MM-dd hh:mm AA" + { + iYear = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iDate = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[6] || // "dd-MMM-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[7] || // "dd-MMM-yyyy hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[14] || // "dd-MMM-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[15]) // "dd-MMM-yyyy hh:mm:ss AA" + { + iDate = parseInt(sArrDate[0]); + iMonth = oDTP._getShortMonthIndex(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + + sTime = sArrDateTime[1]; + if($.cf._isValid(sTime)) + { + if(oDTP.oData.bIs12Hour) { - sArrTimeComp = sTime.split(oDTP.settings.timeMeridiemSeparator); - sTime = sArrTimeComp[0]; - sMeridiem = sArrTimeComp[1]; + if($.cf._compare(oDTP.settings.dateTimeSeparator, oDTP.settings.timeMeridiemSeparator) && (sArrDateTime.length === 3)) + sMeridiem = sArrDateTime[2]; + else + { + sArrTimeComp = sTime.split(oDTP.settings.timeMeridiemSeparator); + sTime = sArrTimeComp[0]; + sMeridiem = sArrTimeComp[1]; + } + + if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) + sMeridiem = ""; } - - if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) - sMeridiem = ""; + + sArrTime = sTime.split(oDTP.settings.timeSeparator); + + iHour = parseInt(sArrTime[0]); + iMinutes = parseInt(sArrTime[1]); + if(bShowSeconds) + { + iSeconds = parseInt(sArrTime[2]); + } + + if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) + iHour = 0; + else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) + iHour += 12; } - - sArrTime = sTime.split(oDTP.settings.timeSeparator); + } + else + { + iDate = sDateTime.getDate(); + iMonth = sDateTime.getMonth(); + iYear = sDateTime.getFullYear(); + + iHour = sDateTime.getHours(); + iMinutes = sDateTime.getMinutes(); - iHour = parseInt(sArrTime[0]); - iMinutes = parseInt(sArrTime[1]); if(bShowSeconds) { - iSeconds = parseInt(sArrTime[2]); + iSeconds = sDateTime.getSeconds(); + iSeconds = oDTP._adjustSeconds(iSeconds); } - - if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) - iHour = 0; - else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) - iHour += 12; } } iMinutes = oDTP._adjustMinutes(iMinutes); diff --git a/dist/DateTimePicker.min.css b/dist/DateTimePicker.min.css index 7413951..cba6e8b 100644 --- a/dist/DateTimePicker.min.css +++ b/dist/DateTimePicker.min.css @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/DateTimePicker.min.js b/dist/DateTimePicker.min.js index 8a1ca78..a78ae9b 100644 --- a/dist/DateTimePicker.min.js +++ b/dist/DateTimePicker.min.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker @@ -9,4 +9,4 @@ ----------------------------------------------------------------------------- */ Object.keys||(Object.keys=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b}),$.DateTimePicker=$.DateTimePicker||{name:"DateTimePicker",i18n:{},defaults:{mode:"date",defaultDate:null,dateSeparator:"-",timeSeparator:":",timeMeridiemSeparator:" ",dateTimeSeparator:" ",monthYearSeparator:" ",dateTimeFormat:"dd-MM-yyyy HH:mm",dateFormat:"dd-MM-yyyy",timeFormat:"HH:mm",maxDate:null,minDate:null,maxTime:null,minTime:null,maxDateTime:null,minDateTime:null,shortDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullMonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],labels:null,minuteInterval:1,roundOffMinutes:!0,secondsInterval:1,roundOffSeconds:!0,showHeader:!0,titleContentDate:"Set Date",titleContentTime:"Set Time",titleContentDateTime:"Set Date & Time",buttonsToDisplay:["HeaderCloseButton","SetButton","ClearButton"],setButtonContent:"Set",clearButtonContent:"Clear",incrementButtonContent:"+",decrementButtonContent:"-",setValueInTextboxOnEveryClick:!1,readonlyInputs:!1,animationDuration:400,touchHoldInterval:300,captureTouchHold:!1,mouseHoldInterval:50,captureMouseHold:!1,isPopup:!0,parentElement:"body",isInline:!1,inputElement:null,language:"",init:null,addEventHandlers:null,beforeShow:null,afterShow:null,beforeHide:null,afterHide:null,buttonClicked:null,settingValueOfElement:null,formatHumanDate:null,parseDateTimeString:null,formatDateTimeString:null},dataObject:{dCurrentDate:new Date,iCurrentDay:0,iCurrentMonth:0,iCurrentYear:0,iCurrentHour:0,iCurrentMinutes:0,iCurrentSeconds:0,sCurrentMeridiem:"",iMaxNumberOfDays:0,sDateFormat:"",sTimeFormat:"",sDateTimeFormat:"",dMinValue:null,dMaxValue:null,sArrInputDateFormats:[],sArrInputTimeFormats:[],sArrInputDateTimeFormats:[],bArrMatchFormat:[],bDateMode:!1,bTimeMode:!1,bDateTimeMode:!1,oInputElement:null,iTabIndex:0,bElemFocused:!1,bIs12Hour:!1,sTouchButton:null,iTouchStart:null,oTimeInterval:null,bIsTouchDevice:"ontouchstart"in document.documentElement}},$.cf={_isValid:function(a){return void 0!==a&&null!==a&&""!==a},_compare:function(a,b){var c=void 0!==a&&null!==a,d=void 0!==b&&null!==b;return!(!c||!d)&&a.toLowerCase()===b.toLowerCase()}},function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(b,c){this.element=b;var d="";d=a.cf._isValid(c)&&a.cf._isValid(c.language)?c.language:a.DateTimePicker.defaults.language,this.settings=a.extend({},a.DateTimePicker.defaults,a.DateTimePicker.i18n[d],c),this.options=c,this.oData=a.extend({},a.DateTimePicker.dataObject),this._defaults=a.DateTimePicker.defaults,this._name=a.DateTimePicker.name,this.init()}a.fn.DateTimePicker=function(c){var d,e,f=a(this).data(),g=f?Object.keys(f):[];if("string"!=typeof c)return this.each(function(){a.removeData(this,"plugin_DateTimePicker"),a.data(this,"plugin_DateTimePicker")||a.data(this,"plugin_DateTimePicker",new b(this,c))});if(a.cf._isValid(f))if("destroy"===c){if(g.length>0)for(d in g)if(e=g[d],e.search("plugin_DateTimePicker")!==-1){a(document).unbind("click.DateTimePicker keydown.DateTimePicker keyup.DateTimePicker"),a(this).children().remove(),a(this).removeData(),a(this).unbind(),a(this).removeClass("dtpicker-overlay dtpicker-mobile dtpicker-inline"),f=f[e];break}}else if("object"===c&&g.length>0)for(d in g)if(e=g[d],e.search("plugin_DateTimePicker")!==-1)return f[e]},b.prototype={init:function(){var b=this;b._setDateFormatArray(),b._setTimeFormatArray(),b._setDateTimeFormatArray(),b.settings.isPopup&&!b.settings.isInline&&(b._createPicker(),a(b.element).addClass("dtpicker-mobile")),b.settings.isInline&&(b._createPicker(),b._showPicker(b.settings.inputElement)),b.settings.init&&b.settings.init.call(b),b._addEventHandlersForInput()},_setDateFormatArray:function(){var a=this;a.oData.sArrInputDateFormats=[];var b="";b="dd"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"yyyy",a.oData.sArrInputDateFormats.push(b),b="MM"+a.settings.dateSeparator+"dd"+a.settings.dateSeparator+"yyyy",a.oData.sArrInputDateFormats.push(b),b="yyyy"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"dd",a.oData.sArrInputDateFormats.push(b),b="dd"+a.settings.dateSeparator+"MMM"+a.settings.dateSeparator+"yyyy",a.oData.sArrInputDateFormats.push(b),b="MM"+a.settings.monthYearSeparator+"yyyy",a.oData.sArrInputDateFormats.push(b),b="MMM"+a.settings.monthYearSeparator+"yyyy",a.oData.sArrInputDateFormats.push(b),b="MMMM"+a.settings.monthYearSeparator+"yyyy",a.oData.sArrInputDateFormats.push(b)},_setTimeFormatArray:function(){var a=this;a.oData.sArrInputTimeFormats=[];var b="";b="hh"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss"+a.settings.timeMeridiemSeparator+"AA",a.oData.sArrInputTimeFormats.push(b),b="HH"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss",a.oData.sArrInputTimeFormats.push(b),b="hh"+a.settings.timeSeparator+"mm"+a.settings.timeMeridiemSeparator+"AA",a.oData.sArrInputTimeFormats.push(b),b="HH"+a.settings.timeSeparator+"mm",a.oData.sArrInputTimeFormats.push(b)},_setDateTimeFormatArray:function(){var a=this;a.oData.sArrInputDateTimeFormats=[];var b="",c="",d="";b="dd"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"yyyy",c="HH"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="dd"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="MM"+a.settings.dateSeparator+"dd"+a.settings.dateSeparator+"yyyy",c="HH"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="MM"+a.settings.dateSeparator+"dd"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="yyyy"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"dd",c="HH"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="yyyy"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"dd",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="dd"+a.settings.dateSeparator+"MMM"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="dd"+a.settings.dateSeparator+"MMM"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeSeparator+"ss"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="dd"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"yyyy",c="HH"+a.settings.timeSeparator+"mm",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="dd"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="MM"+a.settings.dateSeparator+"dd"+a.settings.dateSeparator+"yyyy",c="HH"+a.settings.timeSeparator+"mm",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="MM"+a.settings.dateSeparator+"dd"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="yyyy"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"dd",c="HH"+a.settings.timeSeparator+"mm",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="yyyy"+a.settings.dateSeparator+"MM"+a.settings.dateSeparator+"dd",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="dd"+a.settings.dateSeparator+"MMM"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d),b="dd"+a.settings.dateSeparator+"MMM"+a.settings.dateSeparator+"yyyy",c="hh"+a.settings.timeSeparator+"mm"+a.settings.timeMeridiemSeparator+"AA",d=b+a.settings.dateTimeSeparator+c,a.oData.sArrInputDateTimeFormats.push(d)},_matchFormat:function(b,c){var d=this;d.oData.bArrMatchFormat=[],d.oData.bDateMode=!1,d.oData.bTimeMode=!1,d.oData.bDateTimeMode=!1;var e,f=[];for(b=a.cf._isValid(b)?b:d.settings.mode,a.cf._compare(b,"date")?(c=a.cf._isValid(c)?c:d.oData.sDateFormat,d.oData.bDateMode=!0,f=d.oData.sArrInputDateFormats):a.cf._compare(b,"time")?(c=a.cf._isValid(c)?c:d.oData.sTimeFormat,d.oData.bTimeMode=!0,f=d.oData.sArrInputTimeFormats):a.cf._compare(b,"datetime")&&(c=a.cf._isValid(c)?c:d.oData.sDateTimeFormat,d.oData.bDateTimeMode=!0,f=d.oData.sArrInputDateTimeFormats),e=0;e0&&d._matchFormat(b,c)},_createPicker:function(){var b=this;b.settings.isInline?a(b.element).addClass("dtpicker-inline"):(a(b.element).addClass("dtpicker-overlay"),a(".dtpicker-overlay").click(function(a){b._hidePicker("")}));var c="";c+="
",c+="
",c+="
",c+="
",c+="
",c+="
",c+="
",c+="
",a(b.element).html(c)},_addEventHandlersForInput:function(){var b=this;if(!b.settings.isInline){b.oData.oInputElement=null,a(b.settings.parentElement).find("input[type='date'], input[type='time'], input[type='datetime']").each(function(){a(this).attr("data-field",a(this).attr("type")),a(this).attr("type","text")});var c="[data-field='date'], [data-field='time'], [data-field='datetime']";a(b.settings.parentElement).off("focus",c,b._inputFieldFocus).on("focus",c,{obj:b},b._inputFieldFocus),a(b.settings.parentElement).off("click",c,b._inputFieldClick).on("click",c,{obj:b},b._inputFieldClick)}b.settings.addEventHandlers&&b.settings.addEventHandlers.call(b)},_inputFieldFocus:function(a){var b=a.data.obj;b.showDateTimePicker(this),b.oData.bMouseDown=!1},_inputFieldClick:function(b){var c=b.data.obj;a.cf._compare(a(this).prop("tagName"),"input")||c.showDateTimePicker(this),b.stopPropagation()},getDateObjectForInputField:function(b){var c=this;if(a.cf._isValid(b)){var d,e=c._getValueOfElement(b),f=a(b).data("field"),g="";return a.cf._isValid(f)||(f=c.settings.mode),c.settings.formatDateTimeString?d=c.settings.parseDateTimeString.call(c,e,f,a(b)):(g=a(b).data("format"),a.cf._isValid(g)||(a.cf._compare(f,"date")?g=c.settings.dateFormat:a.cf._compare(f,"time")?g=c.settings.timeFormat:a.cf._compare(f,"datetime")&&(g=c.settings.dateTimeFormat)),c._matchFormat(f,g),a.cf._compare(f,"date")?d=c._parseDate(e):a.cf._compare(f,"time")?d=c._parseTime(e):a.cf._compare(f,"datetime")&&(d=c._parseDateTime(e))),d}},setDateTimeStringInInputField:function(b,c){var d=this;c=c||d.oData.dCurrentDate;var e;a.cf._isValid(b)?(e=[],"string"==typeof b?e.push(b):"object"==typeof b&&(e=b)):e=a.cf._isValid(d.settings.parentElement)?a(d.settings.parentElement).find("[data-field='date'], [data-field='time'], [data-field='datetime']"):a("[data-field='date'], [data-field='time'], [data-field='datetime']"),e.each(function(){var b,e,f,g,h=this;b=a(h).data("field"),a.cf._isValid(b)||(b=d.settings.mode),e="Custom",f=!1,d.settings.formatDateTimeString||(e=a(h).data("format"),a.cf._isValid(e)||(a.cf._compare(b,"date")?e=d.settings.dateFormat:a.cf._compare(b,"time")?e=d.settings.timeFormat:a.cf._compare(b,"datetime")&&(e=d.settings.dateTimeFormat)),f=d.getIs12Hour(b,e)),g=d._setOutput(b,e,f,c,h),d._setValueOfElement(g,a(h))})},getDateTimeStringInFormat:function(a,b,c){var d=this;return d._setOutput(a,b,d.getIs12Hour(a,b),c)},showDateTimePicker:function(a){var b=this;null!==b.oData.oInputElement?b.settings.isInline||b._hidePicker(0,a):b._showPicker(a)},_setButtonAction:function(a){var b=this;null!==b.oData.oInputElement&&(b._setValueOfElement(b._setOutput()),a?(b.settings.buttonClicked&&b.settings.buttonClicked.call(b,"TAB",b.oData.oInputElement),b.settings.isInline||b._hidePicker(0)):b.settings.isInline||b._hidePicker(""))},_setOutput:function(b,c,d,e,f){var g=this;e=a.cf._isValid(e)?e:g.oData.dCurrentDate,d=d||g.oData.bIs12Hour;var h,i=g._setVariablesForDate(e,!0,!0),j="",k=g._formatDate(i),l=g._formatTime(i),m=a.extend({},k,l),n="",o="",p=Function.length;return g.settings.formatDateTimeString?j=g.settings.formatDateTimeString.call(g,m,b,f):(g._setMatchFormat(p,b,c),g.oData.bDateMode?g.oData.bArrMatchFormat[0]?j=m.dd+g.settings.dateSeparator+m.MM+g.settings.dateSeparator+m.yyyy:g.oData.bArrMatchFormat[1]?j=m.MM+g.settings.dateSeparator+m.dd+g.settings.dateSeparator+m.yyyy:g.oData.bArrMatchFormat[2]?j=m.yyyy+g.settings.dateSeparator+m.MM+g.settings.dateSeparator+m.dd:g.oData.bArrMatchFormat[3]?j=m.dd+g.settings.dateSeparator+m.monthShort+g.settings.dateSeparator+m.yyyy:g.oData.bArrMatchFormat[4]?j=m.MM+g.settings.monthYearSeparator+m.yyyy:g.oData.bArrMatchFormat[5]?j=m.monthShort+g.settings.monthYearSeparator+m.yyyy:g.oData.bArrMatchFormat[6]&&(j=m.month+g.settings.monthYearSeparator+m.yyyy):g.oData.bTimeMode?g.oData.bArrMatchFormat[0]?j=m.hh+g.settings.timeSeparator+m.mm+g.settings.timeSeparator+m.ss+g.settings.timeMeridiemSeparator+m.ME:g.oData.bArrMatchFormat[1]?j=m.HH+g.settings.timeSeparator+m.mm+g.settings.timeSeparator+m.ss:g.oData.bArrMatchFormat[2]?j=m.hh+g.settings.timeSeparator+m.mm+g.settings.timeMeridiemSeparator+m.ME:g.oData.bArrMatchFormat[3]&&(j=m.HH+g.settings.timeSeparator+m.mm):g.oData.bDateTimeMode&&(g.oData.bArrMatchFormat[0]||g.oData.bArrMatchFormat[1]||g.oData.bArrMatchFormat[8]||g.oData.bArrMatchFormat[9]?n=m.dd+g.settings.dateSeparator+m.MM+g.settings.dateSeparator+m.yyyy:g.oData.bArrMatchFormat[2]||g.oData.bArrMatchFormat[3]||g.oData.bArrMatchFormat[10]||g.oData.bArrMatchFormat[11]?n=m.MM+g.settings.dateSeparator+m.dd+g.settings.dateSeparator+m.yyyy:g.oData.bArrMatchFormat[4]||g.oData.bArrMatchFormat[5]||g.oData.bArrMatchFormat[12]||g.oData.bArrMatchFormat[13]?n=m.yyyy+g.settings.dateSeparator+m.MM+g.settings.dateSeparator+m.dd:(g.oData.bArrMatchFormat[6]||g.oData.bArrMatchFormat[7]||g.oData.bArrMatchFormat[14]||g.oData.bArrMatchFormat[15])&&(n=m.dd+g.settings.dateSeparator+m.monthShort+g.settings.dateSeparator+m.yyyy),h=g.oData.bArrMatchFormat[0]||g.oData.bArrMatchFormat[1]||g.oData.bArrMatchFormat[2]||g.oData.bArrMatchFormat[3]||g.oData.bArrMatchFormat[4]||g.oData.bArrMatchFormat[5]||g.oData.bArrMatchFormat[6]||g.oData.bArrMatchFormat[7],o=d?h?m.hh+g.settings.timeSeparator+m.mm+g.settings.timeSeparator+m.ss+g.settings.timeMeridiemSeparator+m.ME:m.hh+g.settings.timeSeparator+m.mm+g.settings.timeMeridiemSeparator+m.ME:h?m.HH+g.settings.timeSeparator+m.mm+g.settings.timeSeparator+m.ss:m.HH+g.settings.timeSeparator+m.mm,""!==n&&""!==o&&(j=n+g.settings.dateTimeSeparator+o)),g._setMatchFormat(p)),j},_clearButtonAction:function(){var a=this;null!==a.oData.oInputElement&&a._setValueOfElement(""),a.settings.isInline||a._hidePicker("")},_setOutputOnIncrementOrDecrement:function(){var b=this;a.cf._isValid(b.oData.oInputElement)&&b.settings.setValueInTextboxOnEveryClick&&b._setValueOfElement(b._setOutput())},_showPicker:function(b){var c=this;if(null===c.oData.oInputElement){c.oData.oInputElement=b,c.oData.iTabIndex=parseInt(a(b).attr("tabIndex"));var d=a(b).data("field")||"",e=a(b).data("min")||"",f=a(b).data("max")||"",g=a(b).data("format")||"",h=a(b).data("view")||"",i=a(b).data("startend")||"",j=a(b).data("startendelem")||"",k=c._getValueOfElement(b)||"";if(""!==h&&(a.cf._compare(h,"Popup")?c.setIsPopup(!0):c.setIsPopup(!1)),!c.settings.isPopup&&!c.settings.isInline){c._createPicker();var l=a(c.oData.oInputElement).offset().top+a(c.oData.oInputElement).outerHeight(),m=a(c.oData.oInputElement).offset().left,n=a(c.oData.oInputElement).outerWidth();a(c.element).css({position:"absolute",top:l,left:m,width:n,height:"auto"})}c.settings.beforeShow&&c.settings.beforeShow.call(c,b),d=a.cf._isValid(d)?d:c.settings.mode,c.settings.mode=d,a.cf._isValid(g)||(a.cf._compare(d,"date")?g=c.settings.dateFormat:a.cf._compare(d,"time")?g=c.settings.timeFormat:a.cf._compare(d,"datetime")&&(g=c.settings.dateTimeFormat)),c._matchFormat(d,g),c.oData.dMinValue=null,c.oData.dMaxValue=null,c.oData.bIs12Hour=!1;var o,p,q,r,s,t,u,v;c.oData.bDateMode?(o=e||c.settings.minDate,p=f||c.settings.maxDate,c.oData.sDateFormat=g,a.cf._isValid(o)&&(c.oData.dMinValue=c._parseDate(o)),a.cf._isValid(p)&&(c.oData.dMaxValue=c._parseDate(p)),""!==i&&(a.cf._compare(i,"start")||a.cf._compare(i,"end"))&&""!==j&&a(j).length>=1&&(q=c._getValueOfElement(a(j)),""!==q&&(r=c.settings.parseDateTimeString?c.settings.parseDateTimeString.call(c,q,d,a(j)):c._parseDate(q),a.cf._compare(i,"start")?a.cf._isValid(p)?c._compareDates(r,c.oData.dMaxValue)<0&&(c.oData.dMaxValue=new Date(r)):c.oData.dMaxValue=new Date(r):a.cf._compare(i,"end")&&(a.cf._isValid(o)?c._compareDates(r,c.oData.dMinValue)>0&&(c.oData.dMinValue=new Date(r)):c.oData.dMinValue=new Date(r)))),c.settings.parseDateTimeString?c.oData.dCurrentDate=c.settings.parseDateTimeString.call(c,k,d,a(b)):c.oData.dCurrentDate=c._parseDate(k),c.oData.dCurrentDate.setHours(0),c.oData.dCurrentDate.setMinutes(0),c.oData.dCurrentDate.setSeconds(0)):c.oData.bTimeMode?(o=e||c.settings.minTime,p=f||c.settings.maxTime,c.oData.sTimeFormat=g,c.oData.bIs12Hour=c.getIs12Hour(),a.cf._isValid(o)&&(c.oData.dMinValue=c._parseTime(o),a.cf._isValid(p)||(c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[0]?p="11:59:59 PM":c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[1]?p="23:59:59":c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[2]?p="11:59 PM":c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[3]&&(p="23:59"),c.oData.dMaxValue=c._parseTime(p))),a.cf._isValid(p)&&(c.oData.dMaxValue=c._parseTime(p),a.cf._isValid(o)||(c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[0]?o="12:00:00 AM":c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[1]?o="00:00:00":c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[2]?o="12:00 AM":c.oData.sTimeFormat===c.oData.sArrInputTimeFormats[3]&&(o="00:00"),c.oData.dMinValue=c._parseTime(o))),""!==i&&(a.cf._compare(i,"start")||a.cf._compare(i,"end"))&&""!==j&&a(j).length>=1&&(s=c._getValueOfElement(a(j)),""!==s&&(c.settings.parseDateTimeString?r=c.settings.parseDateTimeString.call(c,s,d,a(j)):t=c._parseTime(s),a.cf._compare(i,"start")?(t.setMinutes(t.getMinutes()-1),a.cf._isValid(p)?2===c._compareTime(t,c.oData.dMaxValue)&&(c.oData.dMaxValue=new Date(t)):c.oData.dMaxValue=new Date(t)):a.cf._compare(i,"end")&&(t.setMinutes(t.getMinutes()+1),a.cf._isValid(o)?3===c._compareTime(t,c.oData.dMinValue)&&(c.oData.dMinValue=new Date(t)):c.oData.dMinValue=new Date(t)))),c.settings.parseDateTimeString?c.oData.dCurrentDate=c.settings.parseDateTimeString.call(c,k,d,a(b)):c.oData.dCurrentDate=c._parseTime(k)):c.oData.bDateTimeMode&&(o=e||c.settings.minDateTime,p=f||c.settings.maxDateTime,c.oData.sDateTimeFormat=g,c.oData.bIs12Hour=c.getIs12Hour(),a.cf._isValid(o)&&(c.oData.dMinValue=c._parseDateTime(o)),a.cf._isValid(p)&&(c.oData.dMaxValue=c._parseDateTime(p)),""!==i&&(a.cf._compare(i,"start")||a.cf._compare(i,"end"))&&""!==j&&a(j).length>=1&&(u=c._getValueOfElement(a(j)),""!==u&&(v=c.settings.parseDateTimeString?c.settings.parseDateTimeString.call(c,u,d,a(j)):c._parseDateTime(u),a.cf._compare(i,"start")?a.cf._isValid(p)?c._compareDateTime(v,c.oData.dMaxValue)<0&&(c.oData.dMaxValue=new Date(v)):c.oData.dMaxValue=new Date(v):a.cf._compare(i,"end")&&(a.cf._isValid(o)?c._compareDateTime(v,c.oData.dMinValue)>0&&(c.oData.dMinValue=new Date(v)):c.oData.dMinValue=new Date(v)))),c.settings.parseDateTimeString?c.oData.dCurrentDate=c.settings.parseDateTimeString.call(c,k,d,a(b)):c.oData.dCurrentDate=c._parseDateTime(k)),c._setVariablesForDate(),c._modifyPicker(),a(c.element).fadeIn(c.settings.animationDuration),c.settings.afterShow&&setTimeout(function(){c.settings.afterShow.call(c,b)},c.settings.animationDuration)}},_hidePicker:function(b,c){var d=this,e=d.oData.oInputElement;d.settings.beforeHide&&d.settings.beforeHide.call(d,e),a.cf._isValid(b)||(b=d.settings.animationDuration),a.cf._isValid(d.oData.oInputElement)&&(a(d.oData.oInputElement).blur(),d.oData.oInputElement=null),a(d.element).fadeOut(b),0===b?a(d.element).find(".dtpicker-subcontent").html(""):setTimeout(function(){a(d.element).find(".dtpicker-subcontent").html("")},b),a(document).unbind("click.DateTimePicker keydown.DateTimePicker keyup.DateTimePicker"),d.settings.afterHide&&(0===b?d.settings.afterHide.call(d,e):setTimeout(function(){d.settings.afterHide.call(d,e)},b)),a.cf._isValid(c)&&d._showPicker(c)},_modifyPicker:function(){var b,c,d=this,e=[];d.oData.bDateMode?(b=d.settings.titleContentDate,c=3,d.oData.bArrMatchFormat[0]?e=["day","month","year"]:d.oData.bArrMatchFormat[1]?e=["month","day","year"]:d.oData.bArrMatchFormat[2]?e=["year","month","day"]:d.oData.bArrMatchFormat[3]?e=["day","month","year"]:d.oData.bArrMatchFormat[4]?(c=2,e=["month","year"]):d.oData.bArrMatchFormat[5]?(c=2,e=["month","year"]):d.oData.bArrMatchFormat[6]&&(c=2,e=["month","year"])):d.oData.bTimeMode?(b=d.settings.titleContentTime,d.oData.bArrMatchFormat[0]?(c=4,e=["hour","minutes","seconds","meridiem"]):d.oData.bArrMatchFormat[1]?(c=3,e=["hour","minutes","seconds"]):d.oData.bArrMatchFormat[2]?(c=3,e=["hour","minutes","meridiem"]):d.oData.bArrMatchFormat[3]&&(c=2,e=["hour","minutes"])):d.oData.bDateTimeMode&&(b=d.settings.titleContentDateTime,d.oData.bArrMatchFormat[0]?(c=6,e=["day","month","year","hour","minutes","seconds"]):d.oData.bArrMatchFormat[1]?(c=7,e=["day","month","year","hour","minutes","seconds","meridiem"]):d.oData.bArrMatchFormat[2]?(c=6,e=["month","day","year","hour","minutes","seconds"]):d.oData.bArrMatchFormat[3]?(c=7,e=["month","day","year","hour","minutes","seconds","meridiem"]):d.oData.bArrMatchFormat[4]?(c=6,e=["year","month","day","hour","minutes","seconds"]):d.oData.bArrMatchFormat[5]?(c=7,e=["year","month","day","hour","minutes","seconds","meridiem"]):d.oData.bArrMatchFormat[6]?(c=6,e=["day","month","year","hour","minutes","seconds"]):d.oData.bArrMatchFormat[7]?(c=7,e=["day","month","year","hour","minutes","seconds","meridiem"]):d.oData.bArrMatchFormat[8]?(c=5,e=["day","month","year","hour","minutes"]):d.oData.bArrMatchFormat[9]?(c=6,e=["day","month","year","hour","minutes","meridiem"]):d.oData.bArrMatchFormat[10]?(c=5,e=["month","day","year","hour","minutes"]):d.oData.bArrMatchFormat[11]?(c=6,e=["month","day","year","hour","minutes","meridiem"]):d.oData.bArrMatchFormat[12]?(c=5,e=["year","month","day","hour","minutes"]):d.oData.bArrMatchFormat[13]?(c=6,e=["year","month","day","hour","minutes","meridiem"]):d.oData.bArrMatchFormat[14]?(c=5,e=["day","month","year","hour","minutes"]):d.oData.bArrMatchFormat[15]&&(c=6,e=["day","month","year","hour","minutes","meridiem"]));var f,g="dtpicker-comp"+c,h=!1,i=!1,j=!1;for(f=0;f",h&&(k+="×"),k+="
",k+="");var l="";for(l+="
",f=0;f",l+="
",l+=""+d.settings.incrementButtonContent+"",l+=d.settings.readonlyInputs?"":"",l+=""+d.settings.decrementButtonContent+"",d.settings.labels&&(l+="
"+d.settings.labels[m]+"
"),l+="
",l+="
"}l+="";var n="";n=i&&j?" dtpicker-twoButtons":" dtpicker-singleButton";var o="";o+="";var p=k+l+o;a(d.element).find(".dtpicker-subcontent").html(p),d._setCurrentDate(),d._addEventHandlersForPicker()},_addEventHandlersForPicker:function(){var b,c,d=this;if(d.settings.isInline||a(document).on("click.DateTimePicker",function(a){d._hidePicker("")}),a(document).on("keydown.DateTimePicker",function(e){if(c=parseInt(e.keyCode?e.keyCode:e.which),!a(".dtpicker-compValue").is(":focus")&&9===c)return d._setButtonAction(!0),a("[tabIndex="+(d.oData.iTabIndex+1)+"]").focus(),!1;if(a(".dtpicker-compValue").is(":focus")){if(38===c)return b=a(".dtpicker-compValue:focus").parent().attr("class"),d._incrementDecrementActionsUsingArrowAndMouse(b,"inc"),!1;if(40===c)return b=a(".dtpicker-compValue:focus").parent().attr("class"),d._incrementDecrementActionsUsingArrowAndMouse(b,"dec"),!1}}),d.settings.isInline||a(document).on("keydown.DateTimePicker",function(b){c=parseInt(b.keyCode?b.keyCode:b.which),a(".dtpicker-compValue").is(":focus")||9===c||d._hidePicker("")}),a(".dtpicker-cont *").click(function(a){a.stopPropagation()}),d.settings.readonlyInputs||(a(".dtpicker-compValue").not(".month .dtpicker-compValue, .meridiem .dtpicker-compValue").keyup(function(){this.value=this.value.replace(/[^0-9\.]/g,"")}),a(".dtpicker-compValue").focus(function(){d.oData.bElemFocused=!0,a(this).select()}),a(".dtpicker-compValue").blur(function(){d._getValuesFromInputBoxes(),d._setCurrentDate(),d.oData.bElemFocused=!1;var b=a(this).parent().parent();setTimeout(function(){b.is(":last-child")&&!d.oData.bElemFocused&&d._setButtonAction(!1)},50)}),a(".dtpicker-compValue").keyup(function(b){var c,d=a(this),e=d.val(),f=e.length;d.parent().hasClass("day")||d.parent().hasClass("hour")||d.parent().hasClass("minutes")||d.parent().hasClass("meridiem")?f>2&&(c=e.slice(0,2),d.val(c)):d.parent().hasClass("month")?f>3&&(c=e.slice(0,3),d.val(c)):d.parent().hasClass("year")&&f>4&&(c=e.slice(0,4),d.val(c)),9===parseInt(b.keyCode?b.keyCode:b.which)&&a(this).select()})),a(d.element).find(".dtpicker-compValue").on("mousewheel DOMMouseScroll onmousewheel",function(c){if(a(".dtpicker-compValue").is(":focus")){var e=Math.max(-1,Math.min(1,c.originalEvent.wheelDelta));return e>0?(b=a(".dtpicker-compValue:focus").parent().attr("class"),d._incrementDecrementActionsUsingArrowAndMouse(b,"inc")):(b=a(".dtpicker-compValue:focus").parent().attr("class"),d._incrementDecrementActionsUsingArrowAndMouse(b,"dec")),!1}}),a(d.element).find(".dtpicker-close").click(function(a){d.settings.buttonClicked&&d.settings.buttonClicked.call(d,"CLOSE",d.oData.oInputElement),d.settings.isInline||d._hidePicker("")}),a(d.element).find(".dtpicker-buttonSet").click(function(a){d.settings.buttonClicked&&d.settings.buttonClicked.call(d,"SET",d.oData.oInputElement),d._setButtonAction(!1)}),a(d.element).find(".dtpicker-buttonClear").click(function(a){d.settings.buttonClicked&&d.settings.buttonClicked.call(d,"CLEAR",d.oData.oInputElement),d._clearButtonAction()}),d.settings.captureTouchHold||d.settings.captureMouseHold){var e="";d.settings.captureTouchHold&&d.oData.bIsTouchDevice&&(e+="touchstart touchmove touchend "),d.settings.captureMouseHold&&(e+="mousedown mouseup"),a(".dtpicker-cont *").on(e,function(a){d._clearIntervalForTouchEvents()}),d._bindTouchEvents("day"),d._bindTouchEvents("month"),d._bindTouchEvents("year"),d._bindTouchEvents("hour"),d._bindTouchEvents("minutes"),d._bindTouchEvents("seconds")}else a(d.element).find(".day .increment, .day .increment *").click(function(a){d.oData.iCurrentDay++,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".day .decrement, .day .decrement *").click(function(a){d.oData.iCurrentDay--,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".month .increment, .month .increment *").click(function(a){d.oData.iCurrentMonth++,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".month .decrement, .month .decrement *").click(function(a){d.oData.iCurrentMonth--,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".year .increment, .year .increment *").click(function(a){d.oData.iCurrentYear++,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".year .decrement, .year .decrement *").click(function(a){d.oData.iCurrentYear--,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".hour .increment, .hour .increment *").click(function(a){d.oData.iCurrentHour++,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".hour .decrement, .hour .decrement *").click(function(a){d.oData.iCurrentHour--,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".minutes .increment, .minutes .increment *").click(function(a){d.oData.iCurrentMinutes+=d.settings.minuteInterval,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".minutes .decrement, .minutes .decrement *").click(function(a){d.oData.iCurrentMinutes-=d.settings.minuteInterval,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".seconds .increment, .seconds .increment *").click(function(a){d.oData.iCurrentSeconds+=d.settings.secondsInterval,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()}),a(d.element).find(".seconds .decrement, .seconds .decrement *").click(function(a){d.oData.iCurrentSeconds-=d.settings.secondsInterval,d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()});a(d.element).find(".meridiem .dtpicker-compButton, .meridiem .dtpicker-compButton *").click(function(b){a.cf._compare(d.oData.sCurrentMeridiem,"AM")?(d.oData.sCurrentMeridiem="PM",d.oData.iCurrentHour+=12):a.cf._compare(d.oData.sCurrentMeridiem,"PM")&&(d.oData.sCurrentMeridiem="AM",d.oData.iCurrentHour-=12),d._setCurrentDate(),d._setOutputOnIncrementOrDecrement()})},_adjustMinutes:function(a){var b=this;return b.settings.roundOffMinutes&&1!==b.settings.minuteInterval&&(a=a%b.settings.minuteInterval?a-a%b.settings.minuteInterval+b.settings.minuteInterval:a),a},_adjustSeconds:function(a){var b=this;return b.settings.roundOffSeconds&&1!==b.settings.secondsInterval&&(a=a%b.settings.secondsInterval?a-a%b.settings.secondsInterval+b.settings.secondsInterval:a),a},_getValueOfElement:function(b){var c="";return c=a.cf._compare(a(b).prop("tagName"),"INPUT")?a(b).val():a(b).html()},_setValueOfElement:function(b,c){var d=this;a.cf._isValid(c)||(c=a(d.oData.oInputElement)),a.cf._compare(c.prop("tagName"),"INPUT")?c.val(b):c.html(b);var e=d.getDateObjectForInputField(c);return d.settings.settingValueOfElement&&d.settings.settingValueOfElement.call(d,b,e,c),c.change(),b},_bindTouchEvents:function(b){var c=this;a(c.element).find("."+b+" .increment, ."+b+" .increment *").on("touchstart mousedown",function(d){d.stopPropagation(),a.cf._isValid(c.oData.sTouchButton)||(c.oData.iTouchStart=(new Date).getTime(),c.oData.sTouchButton=b+"-inc",c._setIntervalForTouchEvents())}),a(c.element).find("."+b+" .increment, ."+b+" .increment *").on("touchend mouseup",function(a){a.stopPropagation(),c._clearIntervalForTouchEvents()}),a(c.element).find("."+b+" .decrement, ."+b+" .decrement *").on("touchstart mousedown",function(d){ -d.stopPropagation(),a.cf._isValid(c.oData.sTouchButton)||(c.oData.iTouchStart=(new Date).getTime(),c.oData.sTouchButton=b+"-dec",c._setIntervalForTouchEvents())}),a(c.element).find("."+b+" .decrement, ."+b+" .decrement *").on("touchend mouseup",function(a){a.stopPropagation(),c._clearIntervalForTouchEvents()})},_setIntervalForTouchEvents:function(){var b=this,c=b.oData.bIsTouchDevice?b.settings.touchHoldInterval:b.settings.mouseHoldInterval;if(!a.cf._isValid(b.oData.oTimeInterval)){var d;b.oData.oTimeInterval=setInterval(function(){d=(new Date).getTime()-b.oData.iTouchStart,d>c&&a.cf._isValid(b.oData.sTouchButton)&&("day-inc"===b.oData.sTouchButton?b.oData.iCurrentDay++:"day-dec"===b.oData.sTouchButton?b.oData.iCurrentDay--:"month-inc"===b.oData.sTouchButton?b.oData.iCurrentMonth++:"month-dec"===b.oData.sTouchButton?b.oData.iCurrentMonth--:"year-inc"===b.oData.sTouchButton?b.oData.iCurrentYear++:"year-dec"===b.oData.sTouchButton?b.oData.iCurrentYear--:"hour-inc"===b.oData.sTouchButton?b.oData.iCurrentHour++:"hour-dec"===b.oData.sTouchButton?b.oData.iCurrentHour--:"minute-inc"===b.oData.sTouchButton?b.oData.iCurrentMinutes+=b.settings.minuteInterval:"minute-dec"===b.oData.sTouchButton?b.oData.iCurrentMinutes-=b.settings.minuteInterval:"second-inc"===b.oData.sTouchButton?b.oData.iCurrentSeconds+=b.settings.secondsInterval:"second-dec"===b.oData.sTouchButton&&(b.oData.iCurrentSeconds-=b.settings.secondsInterval),b._setCurrentDate(),b._setOutputOnIncrementOrDecrement(),b.oData.iTouchStart=(new Date).getTime())},c)}},_clearIntervalForTouchEvents:function(){var b=this;clearInterval(b.oData.oTimeInterval),a.cf._isValid(b.oData.sTouchButton)&&(b.oData.sTouchButton=null,b.oData.iTouchStart=0),b.oData.oTimeInterval=null},_incrementDecrementActionsUsingArrowAndMouse:function(a,b){var c=this;a.includes("day")?"inc"===b?c.oData.iCurrentDay++:"dec"===b&&c.oData.iCurrentDay--:a.includes("month")?"inc"===b?c.oData.iCurrentMonth++:"dec"===b&&c.oData.iCurrentMonth--:a.includes("year")?"inc"===b?c.oData.iCurrentYear++:"dec"===b&&c.oData.iCurrentYear--:a.includes("hour")?"inc"===b?c.oData.iCurrentHour++:"dec"===b&&c.oData.iCurrentHour--:a.includes("minutes")?"inc"===b?c.oData.iCurrentMinutes+=c.settings.minuteInterval:"dec"===b&&(c.oData.iCurrentMinutes-=c.settings.minuteInterval):a.includes("seconds")&&("inc"===b?c.oData.iCurrentSeconds+=c.settings.secondsInterval:"dec"===b&&(c.oData.iCurrentSeconds-=c.settings.secondsInterval)),c._setCurrentDate(),c._setOutputOnIncrementOrDecrement()},_parseDate:function(b){var c=this,d=c.settings.defaultDate?new Date(c.settings.defaultDate):new Date,e=d.getDate(),f=d.getMonth(),g=d.getFullYear();if(a.cf._isValid(b)){var h;h=c.oData.bArrMatchFormat[4]||c.oData.bArrMatchFormat[5]||c.oData.bArrMatchFormat[6]?b.split(c.settings.monthYearSeparator):b.split(c.settings.dateSeparator),c.oData.bArrMatchFormat[0]?(e=parseInt(h[0]),f=parseInt(h[1]-1),g=parseInt(h[2])):c.oData.bArrMatchFormat[1]?(f=parseInt(h[0]-1),e=parseInt(h[1]),g=parseInt(h[2])):c.oData.bArrMatchFormat[2]?(g=parseInt(h[0]),f=parseInt(h[1]-1),e=parseInt(h[2])):c.oData.bArrMatchFormat[3]?(e=parseInt(h[0]),f=c._getShortMonthIndex(h[1]),g=parseInt(h[2])):c.oData.bArrMatchFormat[4]?(e=1,f=parseInt(h[0])-1,g=parseInt(h[1])):c.oData.bArrMatchFormat[5]?(e=1,f=c._getShortMonthIndex(h[0]),g=parseInt(h[1])):c.oData.bArrMatchFormat[6]&&(e=1,f=c._getFullMonthIndex(h[0]),g=parseInt(h[1]))}return d=new Date(g,f,e,0,0,0,0)},_parseTime:function(b){var c,d,e,f=this,g=f.settings.defaultDate?new Date(f.settings.defaultDate):new Date,h=g.getDate(),i=g.getMonth(),j=g.getFullYear(),k=g.getHours(),l=g.getMinutes(),m=g.getSeconds(),n=f.oData.bArrMatchFormat[0]||f.oData.bArrMatchFormat[1];return m=n?f._adjustSeconds(m):0,a.cf._isValid(b)&&(f.oData.bIs12Hour&&(c=b.split(f.settings.timeMeridiemSeparator),b=c[0],d=c[1],a.cf._compare(d,"AM")||a.cf._compare(d,"PM")||(d="")),e=b.split(f.settings.timeSeparator),k=parseInt(e[0]),l=parseInt(e[1]),n&&(m=parseInt(e[2]),m=f._adjustSeconds(m)),12===k&&a.cf._compare(d,"AM")?k=0:k<12&&a.cf._compare(d,"PM")&&(k+=12)),l=f._adjustMinutes(l),g=new Date(j,i,h,k,l,m,0)},_parseDateTime:function(b){var c,d,e,f,g,h=this,i=h.settings.defaultDate?new Date(h.settings.defaultDate):new Date,j=i.getDate(),k=i.getMonth(),l=i.getFullYear(),m=i.getHours(),n=i.getMinutes(),o=i.getSeconds(),p="",q=h.oData.bArrMatchFormat[0]||h.oData.bArrMatchFormat[1]||h.oData.bArrMatchFormat[2]||h.oData.bArrMatchFormat[3]||h.oData.bArrMatchFormat[4]||h.oData.bArrMatchFormat[5]||h.oData.bArrMatchFormat[6]||h.oData.bArrMatchFormat[7];return o=q?h._adjustSeconds(o):0,a.cf._isValid(b)&&(c=b.split(h.settings.dateTimeSeparator),d=c[0].split(h.settings.dateSeparator),h.oData.bArrMatchFormat[0]||h.oData.bArrMatchFormat[1]||h.oData.bArrMatchFormat[8]||h.oData.bArrMatchFormat[9]?(j=parseInt(d[0]),k=parseInt(d[1]-1),l=parseInt(d[2])):h.oData.bArrMatchFormat[2]||h.oData.bArrMatchFormat[3]||h.oData.bArrMatchFormat[10]||h.oData.bArrMatchFormat[11]?(k=parseInt(d[0]-1),j=parseInt(d[1]),l=parseInt(d[2])):h.oData.bArrMatchFormat[4]||h.oData.bArrMatchFormat[5]||h.oData.bArrMatchFormat[12]||h.oData.bArrMatchFormat[13]?(l=parseInt(d[0]),k=parseInt(d[1]-1),j=parseInt(d[2])):(h.oData.bArrMatchFormat[6]||h.oData.bArrMatchFormat[7]||h.oData.bArrMatchFormat[14]||h.oData.bArrMatchFormat[15])&&(j=parseInt(d[0]),k=h._getShortMonthIndex(d[1]),l=parseInt(d[2])),e=c[1],a.cf._isValid(e)&&(h.oData.bIs12Hour&&(a.cf._compare(h.settings.dateTimeSeparator,h.settings.timeMeridiemSeparator)&&3===c.length?p=c[2]:(f=e.split(h.settings.timeMeridiemSeparator),e=f[0],p=f[1]),a.cf._compare(p,"AM")||a.cf._compare(p,"PM")||(p="")),g=e.split(h.settings.timeSeparator),m=parseInt(g[0]),n=parseInt(g[1]),q&&(o=parseInt(g[2])),12===m&&a.cf._compare(p,"AM")?m=0:m<12&&a.cf._compare(p,"PM")&&(m+=12))),n=h._adjustMinutes(n),i=new Date(l,k,j,m,n,o,0)},_getShortMonthIndex:function(b){for(var c=this,d=0;d1&&(c=c.charAt(0).toUpperCase()+c.slice(1)),d=b.settings.shortMonthNames.indexOf(c),d!==-1?b.oData.iCurrentMonth=parseInt(d):c.match("^[+|-]?[0-9]+$")&&(b.oData.iCurrentMonth=parseInt(c-1)),b.oData.iCurrentDay=parseInt(a(b.element).find(".day .dtpicker-compValue").val())||b.oData.iCurrentDay,b.oData.iCurrentYear=parseInt(a(b.element).find(".year .dtpicker-compValue").val())||b.oData.iCurrentYear}if(b.oData.bTimeMode||b.oData.bDateTimeMode){var e,f,g,h;e=parseInt(a(b.element).find(".hour .dtpicker-compValue").val()),f=b._adjustMinutes(parseInt(a(b.element).find(".minutes .dtpicker-compValue").val())),g=b._adjustMinutes(parseInt(a(b.element).find(".seconds .dtpicker-compValue").val())),b.oData.iCurrentHour=isNaN(e)?b.oData.iCurrentHour:e,b.oData.iCurrentMinutes=isNaN(f)?b.oData.iCurrentMinutes:f,b.oData.iCurrentSeconds=isNaN(g)?b.oData.iCurrentSeconds:g,b.oData.iCurrentSeconds>59&&(b.oData.iCurrentMinutes+=b.oData.iCurrentSeconds/60,b.oData.iCurrentSeconds=b.oData.iCurrentSeconds%60),b.oData.iCurrentMinutes>59&&(b.oData.iCurrentHour+=b.oData.iCurrentMinutes/60,b.oData.iCurrentMinutes=b.oData.iCurrentMinutes%60),b.oData.bIs12Hour?b.oData.iCurrentHour>12&&(b.oData.iCurrentHour=b.oData.iCurrentHour%12):b.oData.iCurrentHour>23&&(b.oData.iCurrentHour=b.oData.iCurrentHour%23),b.oData.bIs12Hour&&(h=a(b.element).find(".meridiem .dtpicker-compValue").val(),(a.cf._compare(h,"AM")||a.cf._compare(h,"PM"))&&(b.oData.sCurrentMeridiem=h),a.cf._compare(b.oData.sCurrentMeridiem,"PM")&&12!==b.oData.iCurrentHour&&b.oData.iCurrentHour<13&&(b.oData.iCurrentHour+=12),a.cf._compare(b.oData.sCurrentMeridiem,"AM")&&12===b.oData.iCurrentHour&&(b.oData.iCurrentHour=0))}},_setCurrentDate:function(){var b=this;(b.oData.bTimeMode||b.oData.bDateTimeMode)&&(b.oData.iCurrentSeconds>59?(b.oData.iCurrentMinutes+=b.oData.iCurrentSeconds/60,b.oData.iCurrentSeconds=b.oData.iCurrentSeconds%60):b.oData.iCurrentSeconds<0&&(b.oData.iCurrentMinutes-=b.settings.minuteInterval,b.oData.iCurrentSeconds+=60),b.oData.iCurrentMinutes=b._adjustMinutes(b.oData.iCurrentMinutes),b.oData.iCurrentSeconds=b._adjustSeconds(b.oData.iCurrentSeconds));var c,d,e,f,g,h,i,j=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),k=!1,l=!1;if(null!==b.oData.dMaxValue&&(k=j.getTime()>b.oData.dMaxValue.getTime()),null!==b.oData.dMinValue&&(l=j.getTime()b.oData.dMaxValue.getTime()),null!==b.oData.dMinValue&&(n=b.oData.dCurrentDate.getTime()12&&(e-=12),"00"===g&&(e=12),f=e<10?"0"+e:e,j.oData.bIs12Hour&&(g=f),h=k.iCurrentMinutes,h=h<10?"0"+h:h,i=k.iCurrentSeconds,i=i<10?"0"+i:i,{H:c,HH:d,h:e,hh:f,hour:g,m:k.iCurrentMinutes,mm:h,s:k.iCurrentSeconds,ss:i,ME:k.sCurrentMeridiem}},_setButtons:function(){var b=this;a(b.element).find(".dtpicker-compButton").removeClass("dtpicker-compButtonDisable").addClass("dtpicker-compButtonEnable");var c;if(null!==b.oData.dMaxValue&&(b.oData.bTimeMode?((b.oData.iCurrentHour+1>b.oData.dMaxValue.getHours()||b.oData.iCurrentHour+1===b.oData.dMaxValue.getHours()&&b.oData.iCurrentMinutes>b.oData.dMaxValue.getMinutes())&&a(b.element).find(".hour .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),b.oData.iCurrentHour>=b.oData.dMaxValue.getHours()&&b.oData.iCurrentMinutes+1>b.oData.dMaxValue.getMinutes()&&a(b.element).find(".minutes .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable")):(c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay+1,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".day .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth+1,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".month .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear+1,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".year .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour+1,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".hour .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes+1,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".minutes .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds+1,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".seconds .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"))),null!==b.oData.dMinValue&&(b.oData.bTimeMode?((b.oData.iCurrentHour-1b.oData.dMaxValue.getHours()||d===b.oData.dMaxValue.getHours()&&e>b.oData.dMaxValue.getMinutes())&&a(b.element).find(".meridiem .dtpicker-compButton").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable")):c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".meridiem .dtpicker-compButton").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable")),null!==b.oData.dMinValue&&(b.oData.bTimeMode?(e=b.oData.iCurrentMinutes,(db.getHours()?c=3:a.getHours()===b.getHours()&&(a.getMinutes()b.getMinutes()&&(c=3)),c},_compareDateTime:function(a,b){var c=(a.getTime()-b.getTime())/6e4;return 0===c?c:c/Math.abs(c)},_determineMeridiemFromHourAndMinutes:function(a,b){return a>12||12===a&&b>=0?"PM":"AM"},setLanguage:function(b){var c=this;return c.settings=a.extend({},a.DateTimePicker.defaults,a.DateTimePicker.i18n[b],c.options),c.settings.language=b,c._setDateFormatArray(),c._setTimeFormatArray(),c._setDateTimeFormatArray(),c}}}); \ No newline at end of file +d.stopPropagation(),a.cf._isValid(c.oData.sTouchButton)||(c.oData.iTouchStart=(new Date).getTime(),c.oData.sTouchButton=b+"-dec",c._setIntervalForTouchEvents())}),a(c.element).find("."+b+" .decrement, ."+b+" .decrement *").on("touchend mouseup",function(a){a.stopPropagation(),c._clearIntervalForTouchEvents()})},_setIntervalForTouchEvents:function(){var b=this,c=b.oData.bIsTouchDevice?b.settings.touchHoldInterval:b.settings.mouseHoldInterval;if(!a.cf._isValid(b.oData.oTimeInterval)){var d;b.oData.oTimeInterval=setInterval(function(){d=(new Date).getTime()-b.oData.iTouchStart,d>c&&a.cf._isValid(b.oData.sTouchButton)&&("day-inc"===b.oData.sTouchButton?b.oData.iCurrentDay++:"day-dec"===b.oData.sTouchButton?b.oData.iCurrentDay--:"month-inc"===b.oData.sTouchButton?b.oData.iCurrentMonth++:"month-dec"===b.oData.sTouchButton?b.oData.iCurrentMonth--:"year-inc"===b.oData.sTouchButton?b.oData.iCurrentYear++:"year-dec"===b.oData.sTouchButton?b.oData.iCurrentYear--:"hour-inc"===b.oData.sTouchButton?b.oData.iCurrentHour++:"hour-dec"===b.oData.sTouchButton?b.oData.iCurrentHour--:"minute-inc"===b.oData.sTouchButton?b.oData.iCurrentMinutes+=b.settings.minuteInterval:"minute-dec"===b.oData.sTouchButton?b.oData.iCurrentMinutes-=b.settings.minuteInterval:"second-inc"===b.oData.sTouchButton?b.oData.iCurrentSeconds+=b.settings.secondsInterval:"second-dec"===b.oData.sTouchButton&&(b.oData.iCurrentSeconds-=b.settings.secondsInterval),b._setCurrentDate(),b._setOutputOnIncrementOrDecrement(),b.oData.iTouchStart=(new Date).getTime())},c)}},_clearIntervalForTouchEvents:function(){var b=this;clearInterval(b.oData.oTimeInterval),a.cf._isValid(b.oData.sTouchButton)&&(b.oData.sTouchButton=null,b.oData.iTouchStart=0),b.oData.oTimeInterval=null},_incrementDecrementActionsUsingArrowAndMouse:function(a,b){var c=this;a.includes("day")?"inc"===b?c.oData.iCurrentDay++:"dec"===b&&c.oData.iCurrentDay--:a.includes("month")?"inc"===b?c.oData.iCurrentMonth++:"dec"===b&&c.oData.iCurrentMonth--:a.includes("year")?"inc"===b?c.oData.iCurrentYear++:"dec"===b&&c.oData.iCurrentYear--:a.includes("hour")?"inc"===b?c.oData.iCurrentHour++:"dec"===b&&c.oData.iCurrentHour--:a.includes("minutes")?"inc"===b?c.oData.iCurrentMinutes+=c.settings.minuteInterval:"dec"===b&&(c.oData.iCurrentMinutes-=c.settings.minuteInterval):a.includes("seconds")&&("inc"===b?c.oData.iCurrentSeconds+=c.settings.secondsInterval:"dec"===b&&(c.oData.iCurrentSeconds-=c.settings.secondsInterval)),c._setCurrentDate(),c._setOutputOnIncrementOrDecrement()},_parseDate:function(b){var c=this,d=c.settings.defaultDate?new Date(c.settings.defaultDate):new Date,e=d.getDate(),f=d.getMonth(),g=d.getFullYear();if(a.cf._isValid(b))if("string"==typeof b){var h;h=c.oData.bArrMatchFormat[4]||c.oData.bArrMatchFormat[5]||c.oData.bArrMatchFormat[6]?b.split(c.settings.monthYearSeparator):b.split(c.settings.dateSeparator),c.oData.bArrMatchFormat[0]?(e=parseInt(h[0]),f=parseInt(h[1]-1),g=parseInt(h[2])):c.oData.bArrMatchFormat[1]?(f=parseInt(h[0]-1),e=parseInt(h[1]),g=parseInt(h[2])):c.oData.bArrMatchFormat[2]?(g=parseInt(h[0]),f=parseInt(h[1]-1),e=parseInt(h[2])):c.oData.bArrMatchFormat[3]?(e=parseInt(h[0]),f=c._getShortMonthIndex(h[1]),g=parseInt(h[2])):c.oData.bArrMatchFormat[4]?(e=1,f=parseInt(h[0])-1,g=parseInt(h[1])):c.oData.bArrMatchFormat[5]?(e=1,f=c._getShortMonthIndex(h[0]),g=parseInt(h[1])):c.oData.bArrMatchFormat[6]&&(e=1,f=c._getFullMonthIndex(h[0]),g=parseInt(h[1]))}else e=b.getDate(),f=b.getMonth(),g=b.getFullYear();return d=new Date(g,f,e,0,0,0,0)},_parseTime:function(b){var c,d,e,f=this,g=f.settings.defaultDate?new Date(f.settings.defaultDate):new Date,h=g.getDate(),i=g.getMonth(),j=g.getFullYear(),k=g.getHours(),l=g.getMinutes(),m=g.getSeconds(),n=f.oData.bArrMatchFormat[0]||f.oData.bArrMatchFormat[1];return m=n?f._adjustSeconds(m):0,a.cf._isValid(b)&&("string"==typeof b?(f.oData.bIs12Hour&&(c=b.split(f.settings.timeMeridiemSeparator),b=c[0],d=c[1],a.cf._compare(d,"AM")||a.cf._compare(d,"PM")||(d="")),e=b.split(f.settings.timeSeparator),k=parseInt(e[0]),l=parseInt(e[1]),n&&(m=parseInt(e[2]),m=f._adjustSeconds(m)),12===k&&a.cf._compare(d,"AM")?k=0:k<12&&a.cf._compare(d,"PM")&&(k+=12)):(k=b.getHours(),l=b.getMinutes(),n&&(m=b.getSeconds(),m=f._adjustSeconds(m)))),l=f._adjustMinutes(l),g=new Date(j,i,h,k,l,m,0)},_parseDateTime:function(b){var c,d,e,f,g,h=this,i=h.settings.defaultDate?new Date(h.settings.defaultDate):new Date,j=i.getDate(),k=i.getMonth(),l=i.getFullYear(),m=i.getHours(),n=i.getMinutes(),o=i.getSeconds(),p="",q=h.oData.bArrMatchFormat[0]||h.oData.bArrMatchFormat[1]||h.oData.bArrMatchFormat[2]||h.oData.bArrMatchFormat[3]||h.oData.bArrMatchFormat[4]||h.oData.bArrMatchFormat[5]||h.oData.bArrMatchFormat[6]||h.oData.bArrMatchFormat[7];return o=q?h._adjustSeconds(o):0,a.cf._isValid(b)&&("string"==typeof b?(c=b.split(h.settings.dateTimeSeparator),d=c[0].split(h.settings.dateSeparator),h.oData.bArrMatchFormat[0]||h.oData.bArrMatchFormat[1]||h.oData.bArrMatchFormat[8]||h.oData.bArrMatchFormat[9]?(j=parseInt(d[0]),k=parseInt(d[1]-1),l=parseInt(d[2])):h.oData.bArrMatchFormat[2]||h.oData.bArrMatchFormat[3]||h.oData.bArrMatchFormat[10]||h.oData.bArrMatchFormat[11]?(k=parseInt(d[0]-1),j=parseInt(d[1]),l=parseInt(d[2])):h.oData.bArrMatchFormat[4]||h.oData.bArrMatchFormat[5]||h.oData.bArrMatchFormat[12]||h.oData.bArrMatchFormat[13]?(l=parseInt(d[0]),k=parseInt(d[1]-1),j=parseInt(d[2])):(h.oData.bArrMatchFormat[6]||h.oData.bArrMatchFormat[7]||h.oData.bArrMatchFormat[14]||h.oData.bArrMatchFormat[15])&&(j=parseInt(d[0]),k=h._getShortMonthIndex(d[1]),l=parseInt(d[2])),e=c[1],a.cf._isValid(e)&&(h.oData.bIs12Hour&&(a.cf._compare(h.settings.dateTimeSeparator,h.settings.timeMeridiemSeparator)&&3===c.length?p=c[2]:(f=e.split(h.settings.timeMeridiemSeparator),e=f[0],p=f[1]),a.cf._compare(p,"AM")||a.cf._compare(p,"PM")||(p="")),g=e.split(h.settings.timeSeparator),m=parseInt(g[0]),n=parseInt(g[1]),q&&(o=parseInt(g[2])),12===m&&a.cf._compare(p,"AM")?m=0:m<12&&a.cf._compare(p,"PM")&&(m+=12))):(j=b.getDate(),k=b.getMonth(),l=b.getFullYear(),m=b.getHours(),n=b.getMinutes(),q&&(o=b.getSeconds(),o=h._adjustSeconds(o)))),n=h._adjustMinutes(n),i=new Date(l,k,j,m,n,o,0)},_getShortMonthIndex:function(b){for(var c=this,d=0;d1&&(c=c.charAt(0).toUpperCase()+c.slice(1)),d=b.settings.shortMonthNames.indexOf(c),d!==-1?b.oData.iCurrentMonth=parseInt(d):c.match("^[+|-]?[0-9]+$")&&(b.oData.iCurrentMonth=parseInt(c-1)),b.oData.iCurrentDay=parseInt(a(b.element).find(".day .dtpicker-compValue").val())||b.oData.iCurrentDay,b.oData.iCurrentYear=parseInt(a(b.element).find(".year .dtpicker-compValue").val())||b.oData.iCurrentYear}if(b.oData.bTimeMode||b.oData.bDateTimeMode){var e,f,g,h;e=parseInt(a(b.element).find(".hour .dtpicker-compValue").val()),f=b._adjustMinutes(parseInt(a(b.element).find(".minutes .dtpicker-compValue").val())),g=b._adjustMinutes(parseInt(a(b.element).find(".seconds .dtpicker-compValue").val())),b.oData.iCurrentHour=isNaN(e)?b.oData.iCurrentHour:e,b.oData.iCurrentMinutes=isNaN(f)?b.oData.iCurrentMinutes:f,b.oData.iCurrentSeconds=isNaN(g)?b.oData.iCurrentSeconds:g,b.oData.iCurrentSeconds>59&&(b.oData.iCurrentMinutes+=b.oData.iCurrentSeconds/60,b.oData.iCurrentSeconds=b.oData.iCurrentSeconds%60),b.oData.iCurrentMinutes>59&&(b.oData.iCurrentHour+=b.oData.iCurrentMinutes/60,b.oData.iCurrentMinutes=b.oData.iCurrentMinutes%60),b.oData.bIs12Hour?b.oData.iCurrentHour>12&&(b.oData.iCurrentHour=b.oData.iCurrentHour%12):b.oData.iCurrentHour>23&&(b.oData.iCurrentHour=b.oData.iCurrentHour%23),b.oData.bIs12Hour&&(h=a(b.element).find(".meridiem .dtpicker-compValue").val(),(a.cf._compare(h,"AM")||a.cf._compare(h,"PM"))&&(b.oData.sCurrentMeridiem=h),a.cf._compare(b.oData.sCurrentMeridiem,"PM")&&12!==b.oData.iCurrentHour&&b.oData.iCurrentHour<13&&(b.oData.iCurrentHour+=12),a.cf._compare(b.oData.sCurrentMeridiem,"AM")&&12===b.oData.iCurrentHour&&(b.oData.iCurrentHour=0))}},_setCurrentDate:function(){var b=this;(b.oData.bTimeMode||b.oData.bDateTimeMode)&&(b.oData.iCurrentSeconds>59?(b.oData.iCurrentMinutes+=b.oData.iCurrentSeconds/60,b.oData.iCurrentSeconds=b.oData.iCurrentSeconds%60):b.oData.iCurrentSeconds<0&&(b.oData.iCurrentMinutes-=b.settings.minuteInterval,b.oData.iCurrentSeconds+=60),b.oData.iCurrentMinutes=b._adjustMinutes(b.oData.iCurrentMinutes),b.oData.iCurrentSeconds=b._adjustSeconds(b.oData.iCurrentSeconds));var c,d,e,f,g,h,i,j=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),k=!1,l=!1;if(null!==b.oData.dMaxValue&&(k=j.getTime()>b.oData.dMaxValue.getTime()),null!==b.oData.dMinValue&&(l=j.getTime()b.oData.dMaxValue.getTime()),null!==b.oData.dMinValue&&(n=b.oData.dCurrentDate.getTime()12&&(e-=12),"00"===g&&(e=12),f=e<10?"0"+e:e,j.oData.bIs12Hour&&(g=f),h=k.iCurrentMinutes,h=h<10?"0"+h:h,i=k.iCurrentSeconds,i=i<10?"0"+i:i,{H:c,HH:d,h:e,hh:f,hour:g,m:k.iCurrentMinutes,mm:h,s:k.iCurrentSeconds,ss:i,ME:k.sCurrentMeridiem}},_setButtons:function(){var b=this;a(b.element).find(".dtpicker-compButton").removeClass("dtpicker-compButtonDisable").addClass("dtpicker-compButtonEnable");var c;if(null!==b.oData.dMaxValue&&(b.oData.bTimeMode?((b.oData.iCurrentHour+1>b.oData.dMaxValue.getHours()||b.oData.iCurrentHour+1===b.oData.dMaxValue.getHours()&&b.oData.iCurrentMinutes>b.oData.dMaxValue.getMinutes())&&a(b.element).find(".hour .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),b.oData.iCurrentHour>=b.oData.dMaxValue.getHours()&&b.oData.iCurrentMinutes+1>b.oData.dMaxValue.getMinutes()&&a(b.element).find(".minutes .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable")):(c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay+1,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".day .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth+1,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".month .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear+1,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".year .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour+1,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".hour .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes+1,b.oData.iCurrentSeconds,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".minutes .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"),c=new Date(b.oData.iCurrentYear,b.oData.iCurrentMonth,b.oData.iCurrentDay,b.oData.iCurrentHour,b.oData.iCurrentMinutes,b.oData.iCurrentSeconds+1,0),c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".seconds .increment").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable"))),null!==b.oData.dMinValue&&(b.oData.bTimeMode?((b.oData.iCurrentHour-1b.oData.dMaxValue.getHours()||d===b.oData.dMaxValue.getHours()&&e>b.oData.dMaxValue.getMinutes())&&a(b.element).find(".meridiem .dtpicker-compButton").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable")):c.getTime()>b.oData.dMaxValue.getTime()&&a(b.element).find(".meridiem .dtpicker-compButton").removeClass("dtpicker-compButtonEnable").addClass("dtpicker-compButtonDisable")),null!==b.oData.dMinValue&&(b.oData.bTimeMode?(e=b.oData.iCurrentMinutes,(db.getHours()?c=3:a.getHours()===b.getHours()&&(a.getMinutes()b.getMinutes()&&(c=3)),c},_compareDateTime:function(a,b){var c=(a.getTime()-b.getTime())/6e4;return 0===c?c:c/Math.abs(c)},_determineMeridiemFromHourAndMinutes:function(a,b){return a>12||12===a&&b>=0?"PM":"AM"},setLanguage:function(b){var c=this;return c.settings=a.extend({},a.DateTimePicker.defaults,a.DateTimePicker.i18n[b],c.options),c.settings.language=b,c._setDateFormatArray(),c._setTimeFormatArray(),c._setDateTimeFormatArray(),c}}}); \ No newline at end of file diff --git a/dist/DateTimePicker_iOS_fix.js b/dist/DateTimePicker_iOS_fix.js index 4d65c72..98eba13 100644 --- a/dist/DateTimePicker_iOS_fix.js +++ b/dist/DateTimePicker_iOS_fix.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile -Version 0.1.33 +Version 0.1.34 Copyright (c)2016 Curious Solutions LLP, Neha Kadam, and Yanike Mann http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-cs.js b/dist/i18n/DateTimePicker-i18n-cs.js index d39e2a2..c0e681f 100644 --- a/dist/i18n/DateTimePicker-i18n-cs.js +++ b/dist/i18n/DateTimePicker-i18n-cs.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-de.js b/dist/i18n/DateTimePicker-i18n-de.js index 0cbc71e..d7ab982 100644 --- a/dist/i18n/DateTimePicker-i18n-de.js +++ b/dist/i18n/DateTimePicker-i18n-de.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-en.js b/dist/i18n/DateTimePicker-i18n-en.js index 7abb4b1..c641445 100644 --- a/dist/i18n/DateTimePicker-i18n-en.js +++ b/dist/i18n/DateTimePicker-i18n-en.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-es.js b/dist/i18n/DateTimePicker-i18n-es.js index 685b8aa..028f5cd 100644 --- a/dist/i18n/DateTimePicker-i18n-es.js +++ b/dist/i18n/DateTimePicker-i18n-es.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-fr.js b/dist/i18n/DateTimePicker-i18n-fr.js index f88b78c..217293d 100644 --- a/dist/i18n/DateTimePicker-i18n-fr.js +++ b/dist/i18n/DateTimePicker-i18n-fr.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-it.js b/dist/i18n/DateTimePicker-i18n-it.js index d505184..2711c73 100644 --- a/dist/i18n/DateTimePicker-i18n-it.js +++ b/dist/i18n/DateTimePicker-i18n-it.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-ja.js b/dist/i18n/DateTimePicker-i18n-ja.js index 18f3a8d..62d879c 100755 --- a/dist/i18n/DateTimePicker-i18n-ja.js +++ b/dist/i18n/DateTimePicker-i18n-ja.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-nb.js b/dist/i18n/DateTimePicker-i18n-nb.js index d3433d8..006bc8b 100644 --- a/dist/i18n/DateTimePicker-i18n-nb.js +++ b/dist/i18n/DateTimePicker-i18n-nb.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-nl.js b/dist/i18n/DateTimePicker-i18n-nl.js index 54cc03f..2e8881c 100644 --- a/dist/i18n/DateTimePicker-i18n-nl.js +++ b/dist/i18n/DateTimePicker-i18n-nl.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-ro.js b/dist/i18n/DateTimePicker-i18n-ro.js index 0ab9c5f..cb175dc 100644 --- a/dist/i18n/DateTimePicker-i18n-ro.js +++ b/dist/i18n/DateTimePicker-i18n-ro.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-ru.js b/dist/i18n/DateTimePicker-i18n-ru.js index 7745327..90ffd8e 100644 --- a/dist/i18n/DateTimePicker-i18n-ru.js +++ b/dist/i18n/DateTimePicker-i18n-ru.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-uk.js b/dist/i18n/DateTimePicker-i18n-uk.js index 93ca4d2..bd42091 100644 --- a/dist/i18n/DateTimePicker-i18n-uk.js +++ b/dist/i18n/DateTimePicker-i18n-uk.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n-zh-TW.js b/dist/i18n/DateTimePicker-i18n-zh-TW.js index b0f3872..fb5b737 100644 --- a/dist/i18n/DateTimePicker-i18n-zh-TW.js +++ b/dist/i18n/DateTimePicker-i18n-zh-TW.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DateTimePicker-i18n.js b/dist/i18n/DateTimePicker-i18n.js index ad253d0..6ef9476 100644 --- a/dist/i18n/DateTimePicker-i18n.js +++ b/dist/i18n/DateTimePicker-i18n.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/dist/i18n/DatetimePicker-i18n-zh-CN.js b/dist/i18n/DatetimePicker-i18n-zh-CN.js index f1d08f0..b50dc48 100644 --- a/dist/i18n/DatetimePicker-i18n-zh-CN.js +++ b/dist/i18n/DatetimePicker-i18n-zh-CN.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/package.json b/package.json index 992d16d..618dcab 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "input" ], - "version": "0.1.33", + "version": "0.1.34", "homepage": "http://curioussolutions.github.io/DateTimePicker/", diff --git a/src/DateTimePicker-ltie9.css b/src/DateTimePicker-ltie9.css index 49c7096..318b688 100755 --- a/src/DateTimePicker-ltie9.css +++ b/src/DateTimePicker-ltie9.css @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/DateTimePicker-ltie9.js b/src/DateTimePicker-ltie9.js index b2e4df2..803abc2 100755 --- a/src/DateTimePicker-ltie9.js +++ b/src/DateTimePicker-ltie9.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/DateTimePicker.css b/src/DateTimePicker.css index 83341be..524a477 100755 --- a/src/DateTimePicker.css +++ b/src/DateTimePicker.css @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/DateTimePicker.js b/src/DateTimePicker.js index 20156f7..283c88c 100755 --- a/src/DateTimePicker.js +++ b/src/DateTimePicker.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker @@ -9,12 +9,16 @@ ----------------------------------------------------------------------------- */ /* Support Object.keys in IE8 */ -if (!Object.keys) { - Object.keys = function(obj) { +if(!Object.keys) +{ + Object.keys = function(obj) + { var keys = []; - for (var i in obj) { - if (obj.hasOwnProperty(i)) { + for (var i in obj) + { + if (obj.hasOwnProperty(i)) + { keys.push(i); } } @@ -1142,7 +1146,7 @@ $.cf = { oDTP.oData.dMinValue = oDTP._parseDateTime(sMin); if($.cf._isValid(sMax)) oDTP.oData.dMaxValue = oDTP._parseDateTime(sMax); - + if(sStartEnd !== "" && ($.cf._compare(sStartEnd, "start") || $.cf._compare(sStartEnd, "end")) && sStartEndElem !== "") { if($(sStartEndElem).length >= 1) @@ -2033,53 +2037,62 @@ $.cf = { if($.cf._isValid(sDate)) { - var sArrDate; - if(oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6]) - sArrDate = sDate.split(oDTP.settings.monthYearSeparator); - else - sArrDate = sDate.split(oDTP.settings.dateSeparator); - - if(oDTP.oData.bArrMatchFormat[0]) // "dd-MM-yyyy" - { - iDate = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[1]) // "MM-dd-yyyy" - { - iMonth = parseInt(sArrDate[0] - 1); - iDate = parseInt(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[2]) // "yyyy-MM-dd" + if(typeof sDate === "string") { - iYear = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iDate = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[3]) // "dd-MMM-yyyy" - { - iDate = parseInt(sArrDate[0]); - iMonth = oDTP._getShortMonthIndex(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[4]) // "MM-yyyy" - { - iDate = 1; - iMonth = parseInt(sArrDate[0]) - 1; - iYear = parseInt(sArrDate[1]); - } - else if(oDTP.oData.bArrMatchFormat[5]) // "MMM yyyy" - { - iDate = 1; - iMonth = oDTP._getShortMonthIndex(sArrDate[0]); - iYear = parseInt(sArrDate[1]); + var sArrDate; + if(oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6]) + sArrDate = sDate.split(oDTP.settings.monthYearSeparator); + else + sArrDate = sDate.split(oDTP.settings.dateSeparator); + + if(oDTP.oData.bArrMatchFormat[0]) // "dd-MM-yyyy" + { + iDate = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[1]) // "MM-dd-yyyy" + { + iMonth = parseInt(sArrDate[0] - 1); + iDate = parseInt(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[2]) // "yyyy-MM-dd" + { + iYear = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iDate = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[3]) // "dd-MMM-yyyy" + { + iDate = parseInt(sArrDate[0]); + iMonth = oDTP._getShortMonthIndex(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[4]) // "MM-yyyy" + { + iDate = 1; + iMonth = parseInt(sArrDate[0]) - 1; + iYear = parseInt(sArrDate[1]); + } + else if(oDTP.oData.bArrMatchFormat[5]) // "MMM yyyy" + { + iDate = 1; + iMonth = oDTP._getShortMonthIndex(sArrDate[0]); + iYear = parseInt(sArrDate[1]); + } + else if(oDTP.oData.bArrMatchFormat[6]) // "MMMM yyyy" + { + iDate = 1; + iMonth = oDTP._getFullMonthIndex(sArrDate[0]); + iYear = parseInt(sArrDate[1]); + } } - else if(oDTP.oData.bArrMatchFormat[6]) // "MMMM yyyy" + else { - iDate = 1; - iMonth = oDTP._getFullMonthIndex(sArrDate[0]); - iYear = parseInt(sArrDate[1]); + iDate = sDate.getDate(); + iMonth = sDate.getMonth(); + iYear = sDate.getFullYear(); } } @@ -2106,30 +2119,44 @@ $.cf = { if($.cf._isValid(sTime)) { - if(oDTP.oData.bIs12Hour) + if(typeof sTime === "string") { - sArrTime = sTime.split(oDTP.settings.timeMeridiemSeparator); - sTime = sArrTime[0]; - sMeridiem = sArrTime[1]; + if(oDTP.oData.bIs12Hour) + { + sArrTime = sTime.split(oDTP.settings.timeMeridiemSeparator); + sTime = sArrTime[0]; + sMeridiem = sArrTime[1]; - if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) - sMeridiem = ""; - } + if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) + sMeridiem = ""; + } - sArrTimeComp = sTime.split(oDTP.settings.timeSeparator); - iHour = parseInt(sArrTimeComp[0]); - iMinutes = parseInt(sArrTimeComp[1]); + sArrTimeComp = sTime.split(oDTP.settings.timeSeparator); + iHour = parseInt(sArrTimeComp[0]); + iMinutes = parseInt(sArrTimeComp[1]); - if(bShowSeconds) - { - iSeconds = parseInt(sArrTimeComp[2]); - iSeconds = oDTP._adjustSeconds(iSeconds); + if(bShowSeconds) + { + iSeconds = parseInt(sArrTimeComp[2]); + iSeconds = oDTP._adjustSeconds(iSeconds); + } + + if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) + iHour = 0; + else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) + iHour += 12; } + else + { + iHour = sTime.getHours(); + iMinutes = sTime.getMinutes(); - if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) - iHour = 0; - else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) - iHour += 12; + if(bShowSeconds) + { + iSeconds = sTime.getSeconds(); + iSeconds = oDTP._adjustSeconds(iSeconds); + } + } } iMinutes = oDTP._adjustMinutes(iMinutes); @@ -2164,77 +2191,95 @@ $.cf = { if($.cf._isValid(sDateTime)) { - sArrDateTime = sDateTime.split(oDTP.settings.dateTimeSeparator); - sArrDate = sArrDateTime[0].split(oDTP.settings.dateSeparator); - - if(oDTP.oData.bArrMatchFormat[0] || // "dd-MM-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[1] || // ""dd-MM-yyyy hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[8] || // "dd-MM-yyyy HH:mm" - oDTP.oData.bArrMatchFormat[9]) // "dd-MM-yyyy hh:mm AA" - { - iDate = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[2] || // "MM-dd-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[3] || // "MM-dd-yyyy hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[10] || // "MM-dd-yyyy HH:mm" - oDTP.oData.bArrMatchFormat[11]) // "MM-dd-yyyy hh:mm AA" - { - iMonth = parseInt(sArrDate[0] - 1); - iDate = parseInt(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[4] || // "yyyy-MM-dd HH:mm:ss" - oDTP.oData.bArrMatchFormat[5] || // "yyyy-MM-dd hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[12] || // "yyyy-MM-dd HH:mm" - oDTP.oData.bArrMatchFormat[13]) // "yyyy-MM-dd hh:mm AA" - { - iYear = parseInt(sArrDate[0]); - iMonth = parseInt(sArrDate[1] - 1); - iDate = parseInt(sArrDate[2]); - } - else if(oDTP.oData.bArrMatchFormat[6] || // "dd-MMM-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[7] || // "dd-MMM-yyyy hh:mm:ss AA" - oDTP.oData.bArrMatchFormat[14] || // "dd-MMM-yyyy HH:mm:ss" - oDTP.oData.bArrMatchFormat[15]) // "dd-MMM-yyyy hh:mm:ss AA" - { - iDate = parseInt(sArrDate[0]); - iMonth = oDTP._getShortMonthIndex(sArrDate[1]); - iYear = parseInt(sArrDate[2]); - } - - sTime = sArrDateTime[1]; - if($.cf._isValid(sTime)) + if(typeof sDateTime === "string") { - if(oDTP.oData.bIs12Hour) + sArrDateTime = sDateTime.split(oDTP.settings.dateTimeSeparator); + sArrDate = sArrDateTime[0].split(oDTP.settings.dateSeparator); + + if(oDTP.oData.bArrMatchFormat[0] || // "dd-MM-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[1] || // ""dd-MM-yyyy hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[8] || // "dd-MM-yyyy HH:mm" + oDTP.oData.bArrMatchFormat[9]) // "dd-MM-yyyy hh:mm AA" { - if($.cf._compare(oDTP.settings.dateTimeSeparator, oDTP.settings.timeMeridiemSeparator) && (sArrDateTime.length === 3)) - sMeridiem = sArrDateTime[2]; - else + iDate = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[2] || // "MM-dd-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[3] || // "MM-dd-yyyy hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[10] || // "MM-dd-yyyy HH:mm" + oDTP.oData.bArrMatchFormat[11]) // "MM-dd-yyyy hh:mm AA" + { + iMonth = parseInt(sArrDate[0] - 1); + iDate = parseInt(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[4] || // "yyyy-MM-dd HH:mm:ss" + oDTP.oData.bArrMatchFormat[5] || // "yyyy-MM-dd hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[12] || // "yyyy-MM-dd HH:mm" + oDTP.oData.bArrMatchFormat[13]) // "yyyy-MM-dd hh:mm AA" + { + iYear = parseInt(sArrDate[0]); + iMonth = parseInt(sArrDate[1] - 1); + iDate = parseInt(sArrDate[2]); + } + else if(oDTP.oData.bArrMatchFormat[6] || // "dd-MMM-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[7] || // "dd-MMM-yyyy hh:mm:ss AA" + oDTP.oData.bArrMatchFormat[14] || // "dd-MMM-yyyy HH:mm:ss" + oDTP.oData.bArrMatchFormat[15]) // "dd-MMM-yyyy hh:mm:ss AA" + { + iDate = parseInt(sArrDate[0]); + iMonth = oDTP._getShortMonthIndex(sArrDate[1]); + iYear = parseInt(sArrDate[2]); + } + + sTime = sArrDateTime[1]; + if($.cf._isValid(sTime)) + { + if(oDTP.oData.bIs12Hour) { - sArrTimeComp = sTime.split(oDTP.settings.timeMeridiemSeparator); - sTime = sArrTimeComp[0]; - sMeridiem = sArrTimeComp[1]; + if($.cf._compare(oDTP.settings.dateTimeSeparator, oDTP.settings.timeMeridiemSeparator) && (sArrDateTime.length === 3)) + sMeridiem = sArrDateTime[2]; + else + { + sArrTimeComp = sTime.split(oDTP.settings.timeMeridiemSeparator); + sTime = sArrTimeComp[0]; + sMeridiem = sArrTimeComp[1]; + } + + if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) + sMeridiem = ""; } - - if(!($.cf._compare(sMeridiem, "AM") || $.cf._compare(sMeridiem, "PM"))) - sMeridiem = ""; + + sArrTime = sTime.split(oDTP.settings.timeSeparator); + + iHour = parseInt(sArrTime[0]); + iMinutes = parseInt(sArrTime[1]); + if(bShowSeconds) + { + iSeconds = parseInt(sArrTime[2]); + } + + if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) + iHour = 0; + else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) + iHour += 12; } - - sArrTime = sTime.split(oDTP.settings.timeSeparator); + } + else + { + iDate = sDateTime.getDate(); + iMonth = sDateTime.getMonth(); + iYear = sDateTime.getFullYear(); + + iHour = sDateTime.getHours(); + iMinutes = sDateTime.getMinutes(); - iHour = parseInt(sArrTime[0]); - iMinutes = parseInt(sArrTime[1]); if(bShowSeconds) { - iSeconds = parseInt(sArrTime[2]); + iSeconds = sDateTime.getSeconds(); + iSeconds = oDTP._adjustSeconds(iSeconds); } - - if(iHour === 12 && $.cf._compare(sMeridiem, "AM")) - iHour = 0; - else if(iHour < 12 && $.cf._compare(sMeridiem, "PM")) - iHour += 12; } } iMinutes = oDTP._adjustMinutes(iMinutes); diff --git a/src/DateTimePicker_iOS_fix.js b/src/DateTimePicker_iOS_fix.js index 4d65c72..98eba13 100644 --- a/src/DateTimePicker_iOS_fix.js +++ b/src/DateTimePicker_iOS_fix.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile -Version 0.1.33 +Version 0.1.34 Copyright (c)2016 Curious Solutions LLP, Neha Kadam, and Yanike Mann http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-cs.js b/src/i18n/DateTimePicker-i18n-cs.js index d39e2a2..c0e681f 100755 --- a/src/i18n/DateTimePicker-i18n-cs.js +++ b/src/i18n/DateTimePicker-i18n-cs.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-de.js b/src/i18n/DateTimePicker-i18n-de.js index 0cbc71e..d7ab982 100755 --- a/src/i18n/DateTimePicker-i18n-de.js +++ b/src/i18n/DateTimePicker-i18n-de.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-en.js b/src/i18n/DateTimePicker-i18n-en.js index 7abb4b1..c641445 100755 --- a/src/i18n/DateTimePicker-i18n-en.js +++ b/src/i18n/DateTimePicker-i18n-en.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-es.js b/src/i18n/DateTimePicker-i18n-es.js index 685b8aa..028f5cd 100644 --- a/src/i18n/DateTimePicker-i18n-es.js +++ b/src/i18n/DateTimePicker-i18n-es.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-fr.js b/src/i18n/DateTimePicker-i18n-fr.js index f88b78c..217293d 100755 --- a/src/i18n/DateTimePicker-i18n-fr.js +++ b/src/i18n/DateTimePicker-i18n-fr.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-it.js b/src/i18n/DateTimePicker-i18n-it.js index d505184..2711c73 100644 --- a/src/i18n/DateTimePicker-i18n-it.js +++ b/src/i18n/DateTimePicker-i18n-it.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-ja.js b/src/i18n/DateTimePicker-i18n-ja.js index 18f3a8d..62d879c 100755 --- a/src/i18n/DateTimePicker-i18n-ja.js +++ b/src/i18n/DateTimePicker-i18n-ja.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-nb.js b/src/i18n/DateTimePicker-i18n-nb.js index d3433d8..006bc8b 100644 --- a/src/i18n/DateTimePicker-i18n-nb.js +++ b/src/i18n/DateTimePicker-i18n-nb.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-nl.js b/src/i18n/DateTimePicker-i18n-nl.js index 54cc03f..2e8881c 100644 --- a/src/i18n/DateTimePicker-i18n-nl.js +++ b/src/i18n/DateTimePicker-i18n-nl.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-ro.js b/src/i18n/DateTimePicker-i18n-ro.js index 0ab9c5f..cb175dc 100644 --- a/src/i18n/DateTimePicker-i18n-ro.js +++ b/src/i18n/DateTimePicker-i18n-ro.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-ru.js b/src/i18n/DateTimePicker-i18n-ru.js index 7745327..90ffd8e 100644 --- a/src/i18n/DateTimePicker-i18n-ru.js +++ b/src/i18n/DateTimePicker-i18n-ru.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-uk.js b/src/i18n/DateTimePicker-i18n-uk.js index 93ca4d2..bd42091 100644 --- a/src/i18n/DateTimePicker-i18n-uk.js +++ b/src/i18n/DateTimePicker-i18n-uk.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n-zh-TW.js b/src/i18n/DateTimePicker-i18n-zh-TW.js index b0f3872..fb5b737 100755 --- a/src/i18n/DateTimePicker-i18n-zh-TW.js +++ b/src/i18n/DateTimePicker-i18n-zh-TW.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DateTimePicker-i18n.js b/src/i18n/DateTimePicker-i18n.js index ad253d0..6ef9476 100755 --- a/src/i18n/DateTimePicker-i18n.js +++ b/src/i18n/DateTimePicker-i18n.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker diff --git a/src/i18n/DatetimePicker-i18n-zh-CN.js b/src/i18n/DatetimePicker-i18n-zh-CN.js index f1d08f0..b50dc48 100644 --- a/src/i18n/DatetimePicker-i18n-zh-CN.js +++ b/src/i18n/DatetimePicker-i18n-zh-CN.js @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile - Version 0.1.33 + Version 0.1.34 Copyright (c)2016 Curious Solutions LLP and Neha Kadam http://curioussolutions.github.io/DateTimePicker https://github.com/CuriousSolutions/DateTimePicker