jquery-datetimepicker-rails 2.2.9.0 → 2.3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4170f0eb9087b7ae3f9b24ffb3a05cb49653ed9a
4
- data.tar.gz: e92047746ae247217d6d7444c66dcd38f6f6559e
3
+ metadata.gz: d63746b885f054747d363ed080e4f4ccca416028
4
+ data.tar.gz: 34a558ed2ef5835e40aa5c6170aba28ca5fb76c9
5
5
  SHA512:
6
- metadata.gz: 8fbf649fea45546e5d8a665760f741a03a1e97a91439d24be198043962be20458ea68ddcbaf1ea4ce8dde3f6ee05238a4e25df9de2ad911e45d5a1a4442bdab8
7
- data.tar.gz: 2456989e5288b099708e05e3c293708f3f099eb9fcf12f8a91a479d3bc15d3343dc01a410d120acbeeb22857cbcc7d4470d92ecb6a75df2699b381b8d940aed3
6
+ metadata.gz: 29596ba92d0ff25a987fdd9dfee687985316756e9e4f588cceed79f8c7f32372ec90b86a2a3014b0fd67b8a642b4bdc05d84edfbb9b9d44e3ecc349db93785a1
7
+ data.tar.gz: 8ec0eee0f66c766094038c0938a6b11abe52e33893068d4e4df832530969279a11cfb2253258450e1c518516f4897c639ce227a3f6a6c66314713f09adaec170
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @preserve jQuery DateTimePicker plugin v2.2.9
2
+ * @preserve jQuery DateTimePicker plugin v2.3.0
3
3
  * @homepage http://xdsoft.net/jqplugins/datetimepicker/
4
4
  * (c) 2014, Chupurnov Valeriy.
5
5
  */
@@ -151,6 +151,14 @@
151
151
  "Søn", "Man", "Tir", "ons", "Tor", "Fre", "lør"
152
152
  ]
153
153
  },
154
+ no:{ // Norwegian
155
+ months: [
156
+ "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
157
+ ],
158
+ dayOfWeek: [
159
+ "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
160
+ ]
161
+ },
154
162
  ja:{ // Japanese
155
163
  months: [
156
164
  "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
@@ -182,6 +190,14 @@
182
190
  dayOfWeek: [
183
191
  "Ne", "Po", "Út", "St", "Čt", "Pá", "So"
184
192
  ]
193
+ },
194
+ hu:{ // Hungarian
195
+ months: [
196
+ "Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
197
+ ],
198
+ dayOfWeek: [
199
+ "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
200
+ ]
185
201
  }
186
202
  },
187
203
  value:'',
@@ -256,7 +272,8 @@
256
272
  className:'',
257
273
 
258
274
  weekends : [],
259
- yearOffset:0
275
+ yearOffset:0,
276
+ beforeShowDay: null
260
277
  };
261
278
 
262
279
  // fix for ie8
@@ -361,6 +378,7 @@
361
378
  timeboxparent.trigger('scroll_element.xdsoft_scroller',[(top-(coord.y-start.y))/(height-parentHeight)]);
362
379
  event.stopPropagation();
363
380
  event.preventDefault();
381
+ start = pointerEventToXY(event);
364
382
  }
365
383
  });
366
384
  timeboxparent.on('touchend touchcancel',function( event ) {
@@ -517,7 +535,7 @@
517
535
  datepicker.addClass('active');
518
536
  else
519
537
  datepicker.removeClass('active');
520
-
538
+
521
539
  if( options.timepicker )
522
540
  timepicker.addClass('active');
523
541
  else
@@ -776,6 +794,9 @@
776
794
  };
777
795
 
778
796
  _this.strToDateTime = function( sDateTime ) {
797
+ if( sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime) )
798
+ return sDateTime;
799
+
779
800
  var tmpDate = [],timeOffset,currentTime;
780
801
 
781
802
  if( ( tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime) ) && ( tmpDate[2]=Date.parseDate(tmpDate[2], options.formatDate) ) ) {
@@ -916,7 +937,7 @@
916
937
  minDate = new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate());
917
938
  }
918
939
 
919
- var d,y,m,classes = [];
940
+ var d,y,m,classes = [],customDateSettings;
920
941
 
921
942
  while( i<_xdsoft_datetime.currentTime.countDaysInMonth()||start.getDay()!=options.dayOfWeekStart||_xdsoft_datetime.currentTime.getMonth()==start.getMonth() ) {
922
943
  classes = [];
@@ -926,14 +947,22 @@
926
947
 
927
948
  classes.push('xdsoft_date');
928
949
 
929
- if( ( maxDate!==false && start > maxDate )||( minDate!==false && start < minDate ) ){
950
+ if ( options.beforeShowDay && options.beforeShowDay.call ) {
951
+ customDateSettings = options.beforeShowDay.call(datetimepicker, start);
952
+ } else {
953
+ customDateSettings = null;
954
+ }
955
+
956
+ if( ( maxDate!==false && start > maxDate )||( minDate!==false && start < minDate )||(customDateSettings && customDateSettings[0] === false) ){
930
957
  classes.push('xdsoft_disabled');
931
958
  }
932
959
 
933
- if( _xdsoft_datetime.currentTime.getMonth()!=m ){
934
- classes.push('xdsoft_other_month');
960
+ if ( customDateSettings && customDateSettings[1] != "" ) {
961
+ classes.push(customDateSettings[1]);
935
962
  }
936
963
 
964
+ if( _xdsoft_datetime.currentTime.getMonth()!=m ) classes.push('xdsoft_other_month');
965
+
937
966
  if( (options.defaultSelect||datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat( options.formatDate )==start.dateFormat( options.formatDate ) ) {
938
967
  classes.push('xdsoft_current');
939
968
  }
@@ -1237,16 +1266,23 @@
1237
1266
  datetimepicker.setOptions(options);
1238
1267
 
1239
1268
  function getCurrentValue(){
1240
- var ct = options.value?options.value:(input&&input.val&&input.val())?input.val():'';
1241
-
1242
- if( ct && _xdsoft_datetime.isValidDate(ct = Date.parseDate(ct, options.format)) ) {
1269
+
1270
+ var ct = false;
1271
+
1272
+ if (options.startDate instanceof Date && !isNaN(options.startDate.valueOf())) {
1273
+ ct = options.startDate;
1274
+ } else if (!ct && options.startDate!==false) {
1275
+ ct = _xdsoft_datetime.strToDateTime(options.startDate);
1276
+ } else if (!ct) {
1277
+ ct = options.value?options.value:(input&&input.val&&input.val())?input.val():'';
1278
+ ct = Date.parseDate(ct, options.format);
1279
+ }
1280
+
1281
+ if ( ct && _xdsoft_datetime.isValidDate(ct) ) {
1243
1282
  datetimepicker.data('changed',true);
1244
- }else
1245
- ct = '';
1246
-
1247
- if( !ct && options.startDate!==false ){
1248
- ct = _xdsoft_datetime.strToDateTime(options.startDate);
1249
- }
1283
+ } else {
1284
+ ct = '';
1285
+ }
1250
1286
 
1251
1287
  return ct?ct:0;
1252
1288
  }
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Datetimepicker
3
3
  module Rails
4
- VERSION = '2.2.9.0'
4
+ VERSION = '2.3.0.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-datetimepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.9.0
4
+ version: 2.3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov