xdan-datetimepicker-rails 2.3.8 → 2.3.9

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: d8a80eb7e9c9161576c935bf7b68e299001a6c33
4
- data.tar.gz: 43defa28368ecc6121b3b1de362107e62256ff04
3
+ metadata.gz: ec21208ab5da01226ee3cc5c3ed6131c03c6fa07
4
+ data.tar.gz: 4f098f63bc1d2ada92dce156eb30a4ee4c081ebb
5
5
  SHA512:
6
- metadata.gz: 79585f3e7af6460ecb1de3a5ffb089a1c34d828fb3c14af8466840263a978279b692a34dcb4bb67671657a79e000a05cd3ad2e23b41280d15f4cb552573a3bb4
7
- data.tar.gz: 6bed9ce9051ce2a47322d6919b1b0418adeebef427705d03648c43d9c30e615ee46a2f88202a1bfee0143dbb69fa4dd915737c5d54fef2c61794525e61fdeef3
6
+ metadata.gz: cdf5e8890a54f9c9aaef3a1f63bd1bb96528e291321e555d1c04d8456c0aa25b198d65f489765daf4babad42ce7b607b819dae778cc58dee00c07b3a1c536968
7
+ data.tar.gz: 0e266ecd3cf5ff3044f7a6fb7b50331e1f38971bbfaae2731a697b7718a684a3c4e8dddd828c3f053795f96ba942fdc5f3e342bd24304d5de210bb5c7957342a
@@ -1,8 +1,9 @@
1
1
  /**
2
- * @preserve jQuery DateTimePicker plugin v2.3.8
2
+ * @preserve jQuery DateTimePicker plugin v2.3.9
3
3
  * @homepage http://xdsoft.net/jqplugins/datetimepicker/
4
4
  * (c) 2014, Chupurnov Valeriy.
5
5
  */
6
+ /*global document,window,jQuery,setTimeout,clearTimeout*/
6
7
  (function ($) {
7
8
  'use strict';
8
9
  var default_options = {
@@ -302,8 +303,11 @@
302
303
  roundTime: 'round', // ceil, floor
303
304
  className: '',
304
305
  weekends: [],
306
+ disabledDates : [],
305
307
  yearOffset: 0,
306
- beforeShowDay: null
308
+ beforeShowDay: null,
309
+
310
+ enterLikeTab: true
307
311
  };
308
312
  // fix for ie8
309
313
  if (!Array.prototype.indexOf) {
@@ -348,7 +352,10 @@
348
352
  touchStart = false,
349
353
  startTopScroll = 0,
350
354
  calcOffset = function () {};
351
-
355
+ if (percent === 'hide') {
356
+ timeboxparent.find('.xdsoft_scrollbar').hide();
357
+ return;
358
+ }
352
359
  if (!$(this).hasClass('xdsoft_scroller_box')) {
353
360
  timebox = timeboxparent.children().eq(0);
354
361
  parentHeight = timeboxparent[0].clientHeight;
@@ -532,8 +539,8 @@
532
539
  timepicker = $('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),
533
540
  timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
534
541
  timebox = $('<div class="xdsoft_time_variant"></div>'),
535
- scrollbar = $('<div class="xdsoft_scrollbar"></div>'),
536
- scroller = $('<div class="xdsoft_scroller"></div>'),
542
+ /*scrollbar = $('<div class="xdsoft_scrollbar"></div>'),
543
+ scroller = $('<div class="xdsoft_scroller"></div>'),*/
537
544
  monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
538
545
  yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
539
546
  triggerAfterOpen = false,
@@ -620,6 +627,10 @@
620
627
  options.weekends = $.extend(true, [], _options.weekends);
621
628
  }
622
629
 
630
+ if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
631
+ options.disabledDates = $.extend(true, [], _options.disabledDates);
632
+ }
633
+
623
634
  if ((options.open || options.opened) && (!options.inline)) {
624
635
  input.trigger('open.xdsoft');
625
636
  }
@@ -661,7 +672,7 @@
661
672
  }
662
673
 
663
674
  if (!options.timepickerScrollbar) {
664
- scrollbar.hide();
675
+ timeboxparent.xdsoftScroller('hide');
665
676
  }
666
677
 
667
678
  if (options.minDate && /^-(.*)$/.test(options.minDate)) {
@@ -1143,6 +1154,8 @@
1143
1154
 
1144
1155
  if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
1145
1156
  classes.push('xdsoft_disabled');
1157
+ } else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
1158
+ classes.push('xdsoft_disabled');
1146
1159
  }
1147
1160
 
1148
1161
  if (customDateSettings && customDateSettings[1] !== "") {
@@ -1534,7 +1547,7 @@
1534
1547
  .on('keydown.xdsoft', function (event) {
1535
1548
  var val = this.value, elementSelector,
1536
1549
  key = event.which;
1537
- if ([ENTER].indexOf(key) !== -1) {
1550
+ if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
1538
1551
  elementSelector = $("input:visible,textarea:visible");
1539
1552
  datetimepicker.trigger('close.xdsoft');
1540
1553
  elementSelector.eq(elementSelector.index(this) + 1).focus();
@@ -1,3 +1,3 @@
1
1
  module XdanDatetimepickerRails
2
- VERSION = '2.3.8'
2
+ VERSION = '2.3.9'
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.3.8
4
+ version: 2.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Kovach