xdan-datetimepicker-rails 2.2.9 → 2.3.0

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: 49bc1c630291ced37d857d3190a8115902824aa6
4
- data.tar.gz: 26cd0c40725b2a2876bbdf8888e427860b1928fd
3
+ metadata.gz: ee987cb2ee526ab836d21cb9af3eebb40f58c237
4
+ data.tar.gz: 63f9af2bbecf788288e87789bdcda6b004fad0f0
5
5
  SHA512:
6
- metadata.gz: 866c605c12505cede4f2a7e6f37a2b3323e02ecb402464bab4d278f46c655fb7d123d4de74f92263d861dc6686cb84ec72ca288734c95f17ab04b164eeabcc6c
7
- data.tar.gz: 571cfefcad560798be554cf7a2899985f8a6a5e887c7ec7344c0ce6eff16401898cd4cef2808bc0c97b5f392340169e96abcc96de1e109f3c9be6e04be45bacb
6
+ metadata.gz: 87ca165e3d822c9d9b1c2925047e12d53d599b0ba4eed492e3b1f5b2ad01e1c2bb4c09487e883b30901dae6ab49fdc4264f2c11facc1f593893a073b08eaa96f
7
+ data.tar.gz: 6c1d17fdd8fa1ae8098b7dc64a4120226066f21201f9d7cfb4f447d478dc17b6ebece7229df392f605a7bf2f8d47d6d9e7304ced2650d7a20afb2efa60bc4f64
@@ -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,3 +1,3 @@
1
1
  module XdanDatetimepickerRails
2
- VERSION = '2.2.9'
2
+ VERSION = '2.3.0'
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.9
4
+ version: 2.3.0
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-06-20 00:00:00.000000000 Z
11
+ date: 2014-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails