xdan-datetimepicker-rails 2.4.4 → 2.4.5

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: c4540044f283cee237da711b04abef19d9f02762
4
- data.tar.gz: 117a405cb589b9b0cac60c0c5b09536055285205
3
+ metadata.gz: b02fb62a9ce53094f451362edc2804adb17ebbd9
4
+ data.tar.gz: 073f3908166f9c570a56fc6a9396524237d68b76
5
5
  SHA512:
6
- metadata.gz: a96c3e61b09a9c64dbf976d42a0453b7c60ad3f4f03eac5ebacd600656b368cf3fa46906e236faea8b8d1b79fd4e34f6bc8cd2acdc560681d2fe2c263e694bc1
7
- data.tar.gz: 10d1c0f3d19975a489f05f1ec92f22bcba0e7fb6831c4a66db378b36d2f573c00c05f31d7165c1196d4c54a185379d1204202594dc437895b5ab55b21274059b
6
+ metadata.gz: 548e5526320f218abde9ec644066eefa2515e034ac9d2d96c4129a9e755ac314892cbd3be64c075a971ce11069228a0e7f58351530a3ee809ca1d02519781c0e
7
+ data.tar.gz: 07c2135936094bf896c44d81a2e861951863b88340de800f5eb20f67fa0181d6eb10835f05e4dabffeb5213ddd8870054559e8037333e2ea78d10f17e0faaf3b
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @preserve jQuery DateTimePicker plugin v2.4.4
2
+ * @preserve jQuery DateTimePicker plugin v2.4.5
3
3
  * @homepage http://xdsoft.net/jqplugins/datetimepicker/
4
4
  * (c) 2014, Chupurnov Valeriy.
5
5
  */
@@ -529,6 +529,24 @@
529
529
  showApplyButton: false
530
530
  };
531
531
  // fix for ie8
532
+ if (!window.getComputedStyle) {
533
+ window.getComputedStyle = function (el, pseudo) {
534
+ this.el = el;
535
+ this.getPropertyValue = function (prop) {
536
+ var re = /(\-([a-z]){1})/g;
537
+ if (prop === 'float') {
538
+ prop = 'styleFloat';
539
+ }
540
+ if (re.test(prop)) {
541
+ prop = prop.replace(re, function (a, b, c) {
542
+ return c.toUpperCase();
543
+ });
544
+ }
545
+ return el.currentStyle[prop] || null;
546
+ };
547
+ return this;
548
+ };
549
+ }
532
550
  if (!Array.prototype.indexOf) {
533
551
  Array.prototype.indexOf = function (obj, start) {
534
552
  var i, j;
@@ -773,9 +791,15 @@
773
791
  timer1 = 0,
774
792
  _xdsoft_datetime;
775
793
 
776
- if (options.id) datetimepicker.attr('id', options.id);
777
- if (options.style) datetimepicker.attr('style', options.style);
778
- if (options.weeks) datetimepicker.addClass('xdsoft_showweeks');
794
+ if (options.id) {
795
+ datetimepicker.attr('id', options.id);
796
+ }
797
+ if (options.style) {
798
+ datetimepicker.attr('style', options.style);
799
+ }
800
+ if (options.weeks) {
801
+ datetimepicker.addClass('xdsoft_showweeks');
802
+ }
779
803
 
780
804
  datetimepicker.addClass('xdsoft_' + options.theme);
781
805
  datetimepicker.addClass(options.className);
@@ -953,7 +977,7 @@
953
977
  if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
954
978
  options.disabledDates = $.extend(true, [], _options.disabledDates);
955
979
  }
956
-
980
+
957
981
  if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
958
982
  options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
959
983
  }
@@ -1347,16 +1371,16 @@
1347
1371
  _xdsoft_datetime.setCurrentTime(0);
1348
1372
  datetimepicker.trigger('afterOpen.xdsoft');
1349
1373
  }).on('dblclick.xdsoft', function () {
1350
- var currentDate = _xdsoft_datetime.getCurrentTime();
1351
- currentDate = new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());
1352
- var minDate = _xdsoft_datetime.strToDate(options.minDate);
1353
- minDate = new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate());
1354
- if(currentDate < minDate) {
1374
+ var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate;
1375
+ currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
1376
+ minDate = _xdsoft_datetime.strToDate(options.minDate);
1377
+ minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
1378
+ if (currentDate < minDate) {
1355
1379
  return;
1356
1380
  }
1357
- var maxDate = _xdsoft_datetime.strToDate(options.maxDate);
1358
- maxDate = new Date(maxDate.getFullYear(),maxDate.getMonth(),maxDate.getDate());
1359
- if(currentDate > maxDate) {
1381
+ maxDate = _xdsoft_datetime.strToDate(options.maxDate);
1382
+ maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
1383
+ if (currentDate > maxDate) {
1360
1384
  return;
1361
1385
  }
1362
1386
  input.val(_xdsoft_datetime.str());
@@ -1579,8 +1603,8 @@
1579
1603
  classes.push('xdsoft_disabled');
1580
1604
  }
1581
1605
  if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
1582
- classes.push('xdsoft_disabled');
1583
- }
1606
+ classes.push('xdsoft_disabled');
1607
+ }
1584
1608
 
1585
1609
  current_time = new Date(_xdsoft_datetime.currentTime);
1586
1610
  current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
@@ -1794,7 +1818,7 @@
1794
1818
  current_time_index = 0;
1795
1819
 
1796
1820
  setPos = function () {
1797
- var offset = datetimepicker.data('input').offset(), top = offset.top + datetimepicker.data('input')[0].offsetHeight - 1, left = offset.left, position = "absolute";
1821
+ var offset = datetimepicker.data('input').offset(), top = offset.top + datetimepicker.data('input')[0].offsetHeight - 1, left = offset.left, position = "absolute", node;
1798
1822
  if (options.fixed) {
1799
1823
  top -= $(window).scrollTop();
1800
1824
  left -= $(window).scrollLeft();
@@ -1810,14 +1834,15 @@
1810
1834
  left = $(window).width() - datetimepicker[0].offsetWidth;
1811
1835
  }
1812
1836
  }
1813
- var node = datetimepicker[0]
1837
+
1838
+ node = datetimepicker[0];
1814
1839
  do {
1815
1840
  node = node.parentNode;
1816
- if(window.getComputedStyle(node).getPropertyValue('position') === 'relative' && $(window).width() >= node.offsetWidth) {
1817
- left = left - (($(window).width() - node.offsetWidth)/2)
1818
- break
1841
+ if (window.getComputedStyle(node).getPropertyValue('position') === 'relative' && $(window).width() >= node.offsetWidth) {
1842
+ left = left - (($(window).width() - node.offsetWidth) / 2);
1843
+ break;
1819
1844
  }
1820
- } while(node.nodeName != 'HTML')
1845
+ } while (node.nodeName !== 'HTML');
1821
1846
  datetimepicker.css({
1822
1847
  left: left,
1823
1848
  top: top,
@@ -1,3 +1,3 @@
1
1
  module XdanDatetimepickerRails
2
- VERSION = '2.4.4'
2
+ VERSION = '2.4.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xdan-datetimepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 2.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Kovach