xdan-datetimepicker-rails 2.2.8 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5425514c060aa4c98660cbb8f25e4ce3279f2791
4
- data.tar.gz: 7dc0b85db001237b4932fccf9197a4c53e3485ef
3
+ metadata.gz: 49bc1c630291ced37d857d3190a8115902824aa6
4
+ data.tar.gz: 26cd0c40725b2a2876bbdf8888e427860b1928fd
5
5
  SHA512:
6
- metadata.gz: bb8bad169424fbf8ccaf908a76644f6ca9b005e6d372d7b39f407c70d0fd813715f9f77d1f52a4c0afd622c8cf7ba33ecc94699a1e91551ad2c94769fb9216eb
7
- data.tar.gz: 3cfba2e50d66242f7360468d1d515febb87c7ea21522a2e8f2b805fc138aa4a17006ebd7c879784fe59aac0e33efd5d625d7c320c0b3be2d85510bb8bcc4e6d3
6
+ metadata.gz: 866c605c12505cede4f2a7e6f37a2b3323e02ecb402464bab4d278f46c655fb7d123d4de74f92263d861dc6686cb84ec72ca288734c95f17ab04b164eeabcc6c
7
+ data.tar.gz: 571cfefcad560798be554cf7a2899985f8a6a5e887c7ec7344c0ce6eff16401898cd4cef2808bc0c97b5f392340169e96abcc96de1e109f3c9be6e04be45bacb
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @preserve jQuery DateTimePicker plugin v2.2.8
2
+ * @preserve jQuery DateTimePicker plugin v2.2.9
3
3
  * @homepage http://xdsoft.net/jqplugins/datetimepicker/
4
4
  * (c) 2014, Chupurnov Valeriy.
5
5
  */
6
6
  (function( $ ) {
7
- 'use strict'
7
+ 'use strict';
8
8
  var default_options = {
9
9
  i18n:{
10
10
  bg:{ // Bulgarian
@@ -39,6 +39,14 @@
39
39
  "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
40
40
  ]
41
41
  },
42
+ el:{ // Ελληνικά
43
+ months: [
44
+ "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
45
+ ],
46
+ dayOfWeek: [
47
+ "Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
48
+ ]
49
+ },
42
50
  de:{ // German
43
51
  months:[
44
52
  'Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'
@@ -121,10 +129,10 @@
121
129
  },
122
130
  kr:{ // Korean
123
131
  months: [
124
- "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
132
+ "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
125
133
  ],
126
134
  dayOfWeek: [
127
- "일", "월", "화", "수", "목", "금", "토"
135
+ "일", "월", "화", "수", "목", "금", "토"
128
136
  ]
129
137
  },
130
138
  it:{ // Italian
@@ -158,6 +166,22 @@
158
166
  dayOfWeek: [
159
167
  "CN", "T2", "T3", "T4", "T5", "T6", "T7"
160
168
  ]
169
+ },
170
+ sl:{ // Slovenščina
171
+ months: [
172
+ "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
173
+ ],
174
+ dayOfWeek: [
175
+ "Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
176
+ ]
177
+ },
178
+ cs:{ // Čeština
179
+ months: [
180
+ "Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
181
+ ],
182
+ dayOfWeek: [
183
+ "Ne", "Po", "Út", "St", "Čt", "Pá", "So"
184
+ ]
161
185
  }
162
186
  },
163
187
  value:'',
@@ -173,6 +197,7 @@
173
197
  monthChangeSpinner:true,
174
198
  closeOnDateSelect:false,
175
199
  closeOnWithoutClick:true,
200
+ closeOnInputClick: true,
176
201
 
177
202
  timepicker:true,
178
203
  datepicker:true,
@@ -225,6 +250,8 @@
225
250
  style:'',
226
251
  id:'',
227
252
 
253
+ fixed: false,
254
+
228
255
  roundTime:'round', // ceil, floor
229
256
  className:'',
230
257
 
@@ -240,7 +267,7 @@
240
267
  }
241
268
  return -1;
242
269
  }
243
- };
270
+ }
244
271
 
245
272
  Date.prototype.countDaysInMonth = function(){
246
273
  return new Date(this.getFullYear(), this.getMonth()+1, 0).getDate();
@@ -334,7 +361,7 @@
334
361
  timeboxparent.trigger('scroll_element.xdsoft_scroller',[(top-(coord.y-start.y))/(height-parentHeight)]);
335
362
  event.stopPropagation();
336
363
  event.preventDefault();
337
- };
364
+ }
338
365
  });
339
366
  timeboxparent.on('touchend touchcancel',function( event ) {
340
367
  start = false;
@@ -536,7 +563,7 @@
536
563
  }
537
564
  },
538
565
  setCaretPos = function ( node,pos ) {
539
- var node = (typeof node == "string" || node instanceof String) ? document.getElementById(node) : node;
566
+ node = (typeof node == "string" || node instanceof String) ? document.getElementById(node) : node;
540
567
  if(!node) {
541
568
  return false;
542
569
  }else if(node.createTextRange) {
@@ -723,7 +750,7 @@
723
750
  Date.daysInMonth[month],
724
751
  _this.currentTime.getDate()
725
752
  )
726
- )
753
+ );
727
754
  _this.currentTime.setMonth(month);
728
755
  options.onChangeMonth&&options.onChangeMonth.call&&options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
729
756
  datetimepicker.trigger('xchange.xdsoft');
@@ -741,7 +768,7 @@
741
768
  Date.daysInMonth[month],
742
769
  _this.currentTime.getDate()
743
770
  )
744
- )
771
+ );
745
772
  _this.currentTime.setMonth(month);
746
773
  options.onChangeMonth&&options.onChangeMonth.call&&options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
747
774
  datetimepicker.trigger('xchange.xdsoft');
@@ -752,7 +779,7 @@
752
779
  var tmpDate = [],timeOffset,currentTime;
753
780
 
754
781
  if( ( tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime) ) && ( tmpDate[2]=Date.parseDate(tmpDate[2], options.formatDate) ) ) {
755
- timeOffset = tmpDate[2].getTime()-1*(tmpDate[2].getTimezoneOffset())*60000;
782
+ timeOffset = tmpDate[2].getTime()-(tmpDate[2].getTimezoneOffset())*60000;
756
783
  currentTime = new Date((_xdsoft_datetime.now()).getTime()+parseInt(tmpDate[1]+'1')*timeOffset);
757
784
  }else
758
785
  currentTime = sDateTime?Date.parseDate(sDateTime, options.format):_this.now();
@@ -764,16 +791,24 @@
764
791
  };
765
792
 
766
793
  _this.strtodate = function( sDate ) {
794
+ if( sDate && sDate instanceof Date && _this.isValidDate(sDate) )
795
+ return sDate;
796
+
767
797
  var currentTime = sDate?Date.parseDate(sDate, options.formatDate):_this.now();
768
798
  if( !_this.isValidDate(currentTime) )
769
799
  currentTime = _this.now();
800
+
770
801
  return currentTime;
771
802
  };
772
803
 
773
804
  _this.strtotime = function( sTime ) {
805
+ if( sTime && sTime instanceof Date && _this.isValidDate(sTime) )
806
+ return sTime;
807
+
774
808
  var currentTime = sTime?Date.parseDate(sTime, options.formatTime):_this.now();
775
809
  if( !_this.isValidDate(currentTime) )
776
810
  currentTime = _this.now();
811
+
777
812
  return currentTime;
778
813
  };
779
814
 
@@ -899,22 +934,21 @@
899
934
  classes.push('xdsoft_other_month');
900
935
  }
901
936
 
902
- if( (options.defaultSelect||datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat('d.m.Y')==start.dateFormat('d.m.Y') ) {
937
+ if( (options.defaultSelect||datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat( options.formatDate )==start.dateFormat( options.formatDate ) ) {
903
938
  classes.push('xdsoft_current');
904
939
  }
905
940
 
906
- if( today.dateFormat('d.m.Y')==start.dateFormat('d.m.Y') ) {
941
+ if( today.dateFormat( options.formatDate )==start.dateFormat( options.formatDate ) ) {
907
942
  classes.push('xdsoft_today');
908
943
  }
909
944
 
910
- if( start.getDay()==0||start.getDay()==6||~options.weekends.indexOf(start.dateFormat('d.m.Y')) ) {
945
+ if( start.getDay()==0||start.getDay()==6||~options.weekends.indexOf(start.dateFormat( options.formatDate )) ) {
911
946
  classes.push('xdsoft_weekend');
912
947
  }
913
948
 
914
- if(options.beforeShowDay && typeof options.beforeShowDay == 'function')
915
- {
916
- classes.push(options.beforeShowDay(start))
917
- }
949
+ if(options.beforeShowDay && typeof options.beforeShowDay == 'function') {
950
+ classes.push(options.beforeShowDay(start))
951
+ }
918
952
 
919
953
  table+='<td data-date="'+d+'" data-month="'+m+'" data-year="'+y+'"'+' class="xdsoft_date xdsoft_day_of_week'+start.getDay()+' '+ classes.join(' ')+'">'+
920
954
  '<div>'+d+'</div>'+
@@ -1144,16 +1178,23 @@
1144
1178
  }
1145
1179
  });
1146
1180
  var setPos = function() {
1147
- var offset = datetimepicker.data('input').offset(), top = offset.top+datetimepicker.data('input')[0].offsetHeight-1, left = offset.left;
1148
- if( top+datetimepicker[0].offsetHeight>$(window).height()+$(window).scrollTop() )
1149
- top = offset.top-datetimepicker[0].offsetHeight+1;
1150
- if (top < 0)
1151
- top = 0;
1152
- if( left+datetimepicker[0].offsetWidth>$(window).width() )
1153
- left = offset.left-datetimepicker[0].offsetWidth+datetimepicker.data('input')[0].offsetWidth;
1181
+ var offset = datetimepicker.data('input').offset(), top = offset.top+datetimepicker.data('input')[0].offsetHeight-1, left = offset.left, position = "absolute";
1182
+ if (options.fixed) {
1183
+ top -= $(window).scrollTop();
1184
+ left -= $(window).scrollLeft();
1185
+ position = "fixed";
1186
+ }else {
1187
+ if( top+datetimepicker[0].offsetHeight>$(window).height()+$(window).scrollTop() )
1188
+ top = offset.top-datetimepicker[0].offsetHeight+1;
1189
+ if (top < 0)
1190
+ top = 0;
1191
+ if( left+datetimepicker[0].offsetWidth>$(window).width() )
1192
+ left = offset.left-datetimepicker[0].offsetWidth+datetimepicker.data('input')[0].offsetWidth;
1193
+ }
1154
1194
  datetimepicker.css({
1155
1195
  left:left,
1156
- top:top
1196
+ top:top,
1197
+ position: position
1157
1198
  });
1158
1199
  };
1159
1200
  datetimepicker
@@ -1215,7 +1256,7 @@
1215
1256
  input
1216
1257
  .data( 'xdsoft_datetimepicker',datetimepicker )
1217
1258
  .on('open.xdsoft focusin.xdsoft mousedown.xdsoft',function(event) {
1218
- if( input.is(':disabled')||input.is(':hidden')||!input.is(':visible') )
1259
+ if( input.is(':disabled')||input.is(':hidden')||!input.is(':visible')||(input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick) )
1219
1260
  return;
1220
1261
  clearTimeout(timer);
1221
1262
  timer = setTimeout(function() {
@@ -1302,6 +1343,7 @@
1302
1343
  }
1303
1344
  });
1304
1345
  };
1346
+ $.fn.datetimepicker.defaults = default_options;
1305
1347
  })( jQuery );
1306
1348
 
1307
1349
  /*
@@ -1334,4 +1376,4 @@
1334
1376
  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
1335
1377
  * details.
1336
1378
  */
1337
- Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var code="Date.prototype."+funcName+" = function() {return ";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;code+="'"+String.escape(ch)+"' + ";}else{code+=Date.getFormatCode(ch);}}}eval(code.substring(0,code.length-3)+";}");};Date.getFormatCode=function(a){switch(a){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() %12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(a)+"' + ";}};Date.parseDate=function(a,c){if(c=="unixtime"){return new Date(!isNaN(parseInt(a))?parseInt(a)*1000:0);}if(Date.parseFunctions[c]==null){Date.createParser(c);}var b=Date.parseFunctions[c];return Date[b](a);};Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;var code="Date."+funcName+" = function(input) {\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, z = -1;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;regex+=String.escape(ch);}else{obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c;}}}}code+="if (y > 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$");eval(code);};Date.formatCodeToRegex=function(b,a){switch(b){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+a+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+a+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(b)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0");};Date.prototype.getDayOfYear=function(){var a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;b<this.getMonth();++b){a+=Date.daysInMonth[b];}return a+this.getDate();};Date.prototype.getWeekOfYear=function(){var b=this.getDayOfYear()+(4-this.getDay());var a=new Date(this.getFullYear(),0,1);var c=(7-a.getDay()+4);return String.leftPad(Math.ceil((b-c)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return((a&3)==0&&(a%100||(a%400==0&&a)));};Date.prototype.getFirstDayOfMonth=function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a;};Date.prototype.getLastDayOfMonth=function(){var a=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(a<0)?(a+7):a;};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()];};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};String.escape=function(a){return a.replace(/('|\\)/g,"\\$1");};String.leftPad=function(d,b,c){var a=new String(d);if(c==null){c=" ";}while(a.length<b){a=c+a;}return a;};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.patterns={ISO8601LongPattern:"Y-m-d H:i:s",ISO8601ShortPattern:"Y-m-d",ShortDatePattern:"n/j/Y",LongDatePattern:"l, F d, Y",FullDateTimePattern:"l, F d, Y g:i:s A",MonthDayPattern:"F d",ShortTimePattern:"g:i A",LongTimePattern:"g:i:s A",SortableDateTimePattern:"Y-m-d\\TH:i:s",UniversalSortableDateTimePattern:"Y-m-d H:i:sO",YearMonthPattern:"F, Y"};
1379
+ Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var code="Date.prototype."+funcName+" = function() {return ";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;code+="'"+String.escape(ch)+"' + ";}else{code+=Date.getFormatCode(ch);}}}eval(code.substring(0,code.length-3)+";}");};Date.getFormatCode=function(a){switch(a){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() %12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(a)+"' + ";}};Date.parseDate=function(a,c){if(c=="unixtime"){return new Date(!isNaN(parseInt(a))?parseInt(a)*1000:0);}if(Date.parseFunctions[c]==null){Date.createParser(c);}var b=Date.parseFunctions[c];return Date[b](a);};Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;var code="Date."+funcName+" = function(input) {\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, z = -1;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;regex+=String.escape(ch);}else{obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c;}}}}code+="if (y > 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$");eval(code);};Date.formatCodeToRegex=function(b,a){switch(b){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+a+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+a+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(b)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0");};Date.prototype.getDayOfYear=function(){var a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;b<this.getMonth();++b){a+=Date.daysInMonth[b];}return a+this.getDate();};Date.prototype.getWeekOfYear=function(){var b=this.getDayOfYear()+(4-this.getDay());var a=new Date(this.getFullYear(),0,1);var c=(7-a.getDay()+4);return String.leftPad(Math.ceil((b-c)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return((a&3)==0&&(a%100||(a%400==0&&a)));};Date.prototype.getFirstDayOfMonth=function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a;};Date.prototype.getLastDayOfMonth=function(){var a=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(a<0)?(a+7):a;};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()];};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};String.escape=function(a){return a.replace(/('|\\)/g,"\\$1");};String.leftPad=function(d,b,c){var a=new String(d);if(c==null){c=" ";}while(a.length<b){a=c+a;}return a;};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.patterns={ISO8601LongPattern:"Y-m-d H:i:s",ISO8601ShortPattern:"Y-m-d",ShortDatePattern:"n/j/Y",LongDatePattern:"l, F d, Y",FullDateTimePattern:"l, F d, Y g:i:s A",MonthDayPattern:"F d",ShortTimePattern:"g:i A",LongTimePattern:"g:i:s A",SortableDateTimePattern:"Y-m-d\\TH:i:s",UniversalSortableDateTimePattern:"Y-m-d H:i:sO",YearMonthPattern:"F, Y"};
@@ -6,7 +6,6 @@
6
6
  border-right: 1px solid #CCCCCC;
7
7
  border-top: 1px solid #CCCCCC;
8
8
  color: #333333;
9
- display: block;
10
9
  font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
11
10
  padding: 8px;
12
11
  padding-left: 0px;
@@ -178,7 +177,6 @@
178
177
  .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select{
179
178
  border:1px solid #ccc;
180
179
  position:absolute;
181
- display:block;
182
180
  right:0px;
183
181
  top:30px;
184
182
  z-index:101;
@@ -225,7 +223,6 @@
225
223
  }
226
224
  .xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th{
227
225
  width:14.2857142%;
228
- text-align:center;
229
226
  background: #F5F5F5;
230
227
  border:1px solid #DDDDDD;
231
228
  color: #666666;
@@ -293,7 +290,6 @@
293
290
  .xdsoft_scrollbar{
294
291
  position:absolute;
295
292
  width:7px;
296
- width:7px;
297
293
  right:0px;
298
294
  top:0px;
299
295
  bottom:0px;
@@ -301,4 +297,4 @@
301
297
  }
302
298
  .xdsoft_scroller_box{
303
299
  position:relative;
304
- }
300
+ }
@@ -1,3 +1,3 @@
1
1
  module XdanDatetimepickerRails
2
- VERSION = '2.2.8'
2
+ VERSION = '2.2.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xdan-datetimepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Kovach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-28 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.2.2
104
+ rubygems_version: 2.3.0
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: XDan's jQuery DateTimePicker packaged for the Rails Asset Pipeline