jquery-dateandtimepicker-rails 1.0.3 → 1.0.4

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: b0c3c1d50006f70547bedfa007b831687e839959
4
- data.tar.gz: 0aeada905f5dbd46ec872127edbb124e538376de
3
+ metadata.gz: 8c284efb99526f9981730c05164a4f989cf14b29
4
+ data.tar.gz: 205ed244ff592e42734f0c7ee07b24bcd3136d1c
5
5
  SHA512:
6
- metadata.gz: d804abbf88a94750625bf38532be129246d50ff2a0b298479ce42c54cb6e78069c23bcb2a776bc659e393ab9390d619f1d613d26a66899b2a01f86cc5242d5a1
7
- data.tar.gz: 746f4a6b373ed4143403f7526b82387da336ed3f932950a50709aa699d1382169cc6effa3e018eaaebecbe27b5d8a8d7c54c09debdd0c97c89bb2922b1b73b32
6
+ metadata.gz: 0f800be9f8a599a4446e373ece1cecab8d01201842f0f187f6f0e87c4f713479705ed6aabbe0b49960ee87bddfd415e46176bdb1c1db80f0673d8cfda60376e5
7
+ data.tar.gz: 77a558de65c12e3aa9f5bae91ea273af03f80be8bcf658fe161451b61455e5bcd961ae8ad53eabad38fe86b7aef5d51a4517f4900d02c0e51dc972a0e26c0fca
data/README.md CHANGED
@@ -9,7 +9,7 @@ jQuery Date and Time picker plugin version: `v2.5.14`
9
9
 
10
10
  Add this line to your application's Gemfile:
11
11
 
12
- gem 'jquery-dateandtimepicker-rails', '~> 1.0.3'
12
+ gem 'jquery-dateandtimepicker-rails', '~> 1.0.4'
13
13
 
14
14
  And then execute:
15
15
 
@@ -1,3 +1,13 @@
1
+ /*!
2
+ * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2016
3
+ * @version 1.3.4
4
+ *
5
+ * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format.
6
+ * @see http://php.net/manual/en/function.date.php
7
+ *
8
+ * For more JQuery plugins visit http://plugins.krajee.com
9
+ * For more Yii related demos visit http://demos.krajee.com
10
+ */var DateFormatter;!function(){"use strict";var t,e,r,n,a,u,i;u=864e5,i=3600,t=function(t,e){return"string"==typeof t&&"string"==typeof e&&t.toLowerCase()===e.toLowerCase()},e=function(t,r,n){var a=n||"0",u=t.toString();return u.length<r?e(a+u,r):u},r=function(t){var e,n;for(t=t||{},e=1;e<arguments.length;e++)if(n=arguments[e])for(var a in n)n.hasOwnProperty(a)&&("object"==typeof n[a]?r(t[a],n[a]):t[a]=n[a]);return t},n=function(t,e){for(var r=0;r<e.length;r++)if(e[r].toLowerCase()===t.toLowerCase())return r;return-1},a={dateSettings:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["AM","PM"],ordinal:function(t){var e=t%10,r={1:"st",2:"nd",3:"rd"};return 1!==Math.floor(t%100/10)&&r[e]?r[e]:"th"}},separators:/[ \-+\/\.T:@]/g,validParts:/[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,intParts:/[djwNzmnyYhHgGis]/g,tzParts:/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,tzClip:/[^-+\dA-Z]/g},DateFormatter=function(t){var e=this,n=r(a,t);e.dateSettings=n.dateSettings,e.separators=n.separators,e.validParts=n.validParts,e.intParts=n.intParts,e.tzParts=n.tzParts,e.tzClip=n.tzClip},DateFormatter.prototype={constructor:DateFormatter,getMonth:function(t){var e,r=this;return e=n(t,r.dateSettings.monthsShort)+1,0===e&&(e=n(t,r.dateSettings.months)+1),e},parseDate:function(e,r){var n,a,u,i,s,o,c,f,l,h,d=this,g=!1,m=!1,p=d.dateSettings,y={date:null,year:null,month:null,day:null,hour:0,min:0,sec:0};if(!e)return null;if(e instanceof Date)return e;if("U"===r)return u=parseInt(e),u?new Date(1e3*u):e;switch(typeof e){case"number":return new Date(e);case"string":break;default:return null}if(n=r.match(d.validParts),!n||0===n.length)throw new Error("Invalid date format definition.");for(a=e.replace(d.separators,"\x00").split("\x00"),u=0;u<a.length;u++)switch(i=a[u],s=parseInt(i),n[u]){case"y":case"Y":if(!s)return null;l=i.length,y.year=2===l?parseInt((70>s?"20":"19")+i):s,g=!0;break;case"m":case"n":case"M":case"F":if(isNaN(s)){if(o=d.getMonth(i),!(o>0))return null;y.month=o}else{if(!(s>=1&&12>=s))return null;y.month=s}g=!0;break;case"d":case"j":if(!(s>=1&&31>=s))return null;y.day=s,g=!0;break;case"g":case"h":if(c=n.indexOf("a")>-1?n.indexOf("a"):n.indexOf("A")>-1?n.indexOf("A"):-1,h=a[c],c>-1)f=t(h,p.meridiem[0])?0:t(h,p.meridiem[1])?12:-1,s>=1&&12>=s&&f>-1?y.hour=s+f-1:s>=0&&23>=s&&(y.hour=s);else{if(!(s>=0&&23>=s))return null;y.hour=s}m=!0;break;case"G":case"H":if(!(s>=0&&23>=s))return null;y.hour=s,m=!0;break;case"i":if(!(s>=0&&59>=s))return null;y.min=s,m=!0;break;case"s":if(!(s>=0&&59>=s))return null;y.sec=s,m=!0}if(g===!0&&y.year&&y.month&&y.day)y.date=new Date(y.year,y.month-1,y.day,y.hour,y.min,y.sec,0);else{if(m!==!0)return null;y.date=new Date(0,0,0,y.hour,y.min,y.sec,0)}return y.date},guessDate:function(t,e){if("string"!=typeof t)return t;var r,n,a,u,i,s,o=this,c=t.replace(o.separators,"\x00").split("\x00"),f=/^[djmn]/g,l=e.match(o.validParts),h=new Date,d=0;if(!f.test(l[0]))return t;for(a=0;a<c.length;a++){if(d=2,i=c[a],s=parseInt(i.substr(0,2)),isNaN(s))return null;switch(a){case 0:"m"===l[0]||"n"===l[0]?h.setMonth(s-1):h.setDate(s);break;case 1:"m"===l[0]||"n"===l[0]?h.setDate(s):h.setMonth(s-1);break;case 2:if(n=h.getFullYear(),r=i.length,d=4>r?r:4,n=parseInt(4>r?n.toString().substr(0,4-r)+i:i.substr(0,4)),!n)return null;h.setFullYear(n);break;case 3:h.setHours(s);break;case 4:h.setMinutes(s);break;case 5:h.setSeconds(s)}u=i.substr(d),u.length>0&&c.splice(a+1,0,u)}return h},parseFormat:function(t,r){var n,a=this,s=a.dateSettings,o=/\\?(.?)/gi,c=function(t,e){return n[t]?n[t]():e};return n={d:function(){return e(n.j(),2)},D:function(){return s.daysShort[n.w()]},j:function(){return r.getDate()},l:function(){return s.days[n.w()]},N:function(){return n.w()||7},w:function(){return r.getDay()},z:function(){var t=new Date(n.Y(),n.n()-1,n.j()),e=new Date(n.Y(),0,1);return Math.round((t-e)/u)},W:function(){var t=new Date(n.Y(),n.n()-1,n.j()-n.N()+3),r=new Date(t.getFullYear(),0,4);return e(1+Math.round((t-r)/u/7),2)},F:function(){return s.months[r.getMonth()]},m:function(){return e(n.n(),2)},M:function(){return s.monthsShort[r.getMonth()]},n:function(){return r.getMonth()+1},t:function(){return new Date(n.Y(),n.n(),0).getDate()},L:function(){var t=n.Y();return t%4===0&&t%100!==0||t%400===0?1:0},o:function(){var t=n.n(),e=n.W(),r=n.Y();return r+(12===t&&9>e?1:1===t&&e>9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return n.A().toLowerCase()},A:function(){var t=n.G()<12?0:1;return s.meridiem[t]},B:function(){var t=r.getUTCHours()*i,n=60*r.getUTCMinutes(),a=r.getUTCSeconds();return e(Math.floor((t+n+a+i)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return e(n.g(),2)},H:function(){return e(n.G(),2)},i:function(){return e(r.getMinutes(),2)},s:function(){return e(r.getSeconds(),2)},u:function(){return e(1e3*r.getMilliseconds(),6)},e:function(){var t=/\((.*)\)/.exec(String(r))[1];return t||"Coordinated Universal Time"},I:function(){var t=new Date(n.Y(),0),e=Date.UTC(n.Y(),0),r=new Date(n.Y(),6),a=Date.UTC(n.Y(),6);return t-e!==r-a?1:0},O:function(){var t=r.getTimezoneOffset(),n=Math.abs(t);return(t>0?"-":"+")+e(100*Math.floor(n/60)+n%60,4)},P:function(){var t=n.O();return t.substr(0,3)+":"+t.substr(3,2)},T:function(){var t=(String(r).match(a.tzParts)||[""]).pop().replace(a.tzClip,"");return t||"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(o,c)},r:function(){return"D, d M Y H:i:s O".replace(o,c)},U:function(){return r.getTime()/1e3||0}},c(t,t)},formatDate:function(t,e){var r,n,a,u,i,s=this,o="",c="\\";if("string"==typeof t&&(t=s.parseDate(t,e),!t))return null;if(t instanceof Date){for(a=e.length,r=0;a>r;r++)i=e.charAt(r),"S"!==i&&i!==c&&(r>0&&e.charAt(r-1)===c?o+=i:(u=s.parseFormat(i,t),r!==a-1&&s.intParts.test(i)&&"S"===e.charAt(r+1)&&(n=parseInt(u)||0,u+=s.dateSettings.ordinal(n)),o+=u));return o}return""}}}();
1
11
  /**
2
12
  * @preserve jQuery DateTimePicker
3
13
  * @homepage http://xdsoft.net/jqplugins/datetimepicker/
@@ -2461,3 +2471,226 @@ var datetimepickerFactory = function ($) {
2461
2471
  }
2462
2472
  }(datetimepickerFactory));
2463
2473
 
2474
+
2475
+
2476
+ /*!
2477
+ * jQuery Mousewheel 3.1.13
2478
+ *
2479
+ * Copyright jQuery Foundation and other contributors
2480
+ * Released under the MIT license
2481
+ * http://jquery.org/license
2482
+ */
2483
+
2484
+ (function (factory) {
2485
+ if ( typeof define === 'function' && define.amd ) {
2486
+ // AMD. Register as an anonymous module.
2487
+ define(['jquery'], factory);
2488
+ } else if (typeof exports === 'object') {
2489
+ // Node/CommonJS style for Browserify
2490
+ module.exports = factory;
2491
+ } else {
2492
+ // Browser globals
2493
+ factory(jQuery);
2494
+ }
2495
+ }(function ($) {
2496
+
2497
+ var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
2498
+ toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
2499
+ ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
2500
+ slice = Array.prototype.slice,
2501
+ nullLowestDeltaTimeout, lowestDelta;
2502
+
2503
+ if ( $.event.fixHooks ) {
2504
+ for ( var i = toFix.length; i; ) {
2505
+ $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
2506
+ }
2507
+ }
2508
+
2509
+ var special = $.event.special.mousewheel = {
2510
+ version: '3.1.12',
2511
+
2512
+ setup: function() {
2513
+ if ( this.addEventListener ) {
2514
+ for ( var i = toBind.length; i; ) {
2515
+ this.addEventListener( toBind[--i], handler, false );
2516
+ }
2517
+ } else {
2518
+ this.onmousewheel = handler;
2519
+ }
2520
+ // Store the line height and page height for this particular element
2521
+ $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
2522
+ $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
2523
+ },
2524
+
2525
+ teardown: function() {
2526
+ if ( this.removeEventListener ) {
2527
+ for ( var i = toBind.length; i; ) {
2528
+ this.removeEventListener( toBind[--i], handler, false );
2529
+ }
2530
+ } else {
2531
+ this.onmousewheel = null;
2532
+ }
2533
+ // Clean up the data we added to the element
2534
+ $.removeData(this, 'mousewheel-line-height');
2535
+ $.removeData(this, 'mousewheel-page-height');
2536
+ },
2537
+
2538
+ getLineHeight: function(elem) {
2539
+ var $elem = $(elem),
2540
+ $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
2541
+ if (!$parent.length) {
2542
+ $parent = $('body');
2543
+ }
2544
+ return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
2545
+ },
2546
+
2547
+ getPageHeight: function(elem) {
2548
+ return $(elem).height();
2549
+ },
2550
+
2551
+ settings: {
2552
+ adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
2553
+ normalizeOffset: true // calls getBoundingClientRect for each event
2554
+ }
2555
+ };
2556
+
2557
+ $.fn.extend({
2558
+ mousewheel: function(fn) {
2559
+ return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
2560
+ },
2561
+
2562
+ unmousewheel: function(fn) {
2563
+ return this.unbind('mousewheel', fn);
2564
+ }
2565
+ });
2566
+
2567
+
2568
+ function handler(event) {
2569
+ var orgEvent = event || window.event,
2570
+ args = slice.call(arguments, 1),
2571
+ delta = 0,
2572
+ deltaX = 0,
2573
+ deltaY = 0,
2574
+ absDelta = 0,
2575
+ offsetX = 0,
2576
+ offsetY = 0;
2577
+ event = $.event.fix(orgEvent);
2578
+ event.type = 'mousewheel';
2579
+
2580
+ // Old school scrollwheel delta
2581
+ if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
2582
+ if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
2583
+ if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
2584
+ if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
2585
+
2586
+ // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
2587
+ if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
2588
+ deltaX = deltaY * -1;
2589
+ deltaY = 0;
2590
+ }
2591
+
2592
+ // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
2593
+ delta = deltaY === 0 ? deltaX : deltaY;
2594
+
2595
+ // New school wheel delta (wheel event)
2596
+ if ( 'deltaY' in orgEvent ) {
2597
+ deltaY = orgEvent.deltaY * -1;
2598
+ delta = deltaY;
2599
+ }
2600
+ if ( 'deltaX' in orgEvent ) {
2601
+ deltaX = orgEvent.deltaX;
2602
+ if ( deltaY === 0 ) { delta = deltaX * -1; }
2603
+ }
2604
+
2605
+ // No change actually happened, no reason to go any further
2606
+ if ( deltaY === 0 && deltaX === 0 ) { return; }
2607
+
2608
+ // Need to convert lines and pages to pixels if we aren't already in pixels
2609
+ // There are three delta modes:
2610
+ // * deltaMode 0 is by pixels, nothing to do
2611
+ // * deltaMode 1 is by lines
2612
+ // * deltaMode 2 is by pages
2613
+ if ( orgEvent.deltaMode === 1 ) {
2614
+ var lineHeight = $.data(this, 'mousewheel-line-height');
2615
+ delta *= lineHeight;
2616
+ deltaY *= lineHeight;
2617
+ deltaX *= lineHeight;
2618
+ } else if ( orgEvent.deltaMode === 2 ) {
2619
+ var pageHeight = $.data(this, 'mousewheel-page-height');
2620
+ delta *= pageHeight;
2621
+ deltaY *= pageHeight;
2622
+ deltaX *= pageHeight;
2623
+ }
2624
+
2625
+ // Store lowest absolute delta to normalize the delta values
2626
+ absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
2627
+
2628
+ if ( !lowestDelta || absDelta < lowestDelta ) {
2629
+ lowestDelta = absDelta;
2630
+
2631
+ // Adjust older deltas if necessary
2632
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
2633
+ lowestDelta /= 40;
2634
+ }
2635
+ }
2636
+
2637
+ // Adjust older deltas if necessary
2638
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
2639
+ // Divide all the things by 40!
2640
+ delta /= 40;
2641
+ deltaX /= 40;
2642
+ deltaY /= 40;
2643
+ }
2644
+
2645
+ // Get a whole, normalized value for the deltas
2646
+ delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
2647
+ deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
2648
+ deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
2649
+
2650
+ // Normalise offsetX and offsetY properties
2651
+ if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
2652
+ var boundingRect = this.getBoundingClientRect();
2653
+ offsetX = event.clientX - boundingRect.left;
2654
+ offsetY = event.clientY - boundingRect.top;
2655
+ }
2656
+
2657
+ // Add information to the event object
2658
+ event.deltaX = deltaX;
2659
+ event.deltaY = deltaY;
2660
+ event.deltaFactor = lowestDelta;
2661
+ event.offsetX = offsetX;
2662
+ event.offsetY = offsetY;
2663
+ // Go ahead and set deltaMode to 0 since we converted to pixels
2664
+ // Although this is a little odd since we overwrite the deltaX/Y
2665
+ // properties with normalized deltas.
2666
+ event.deltaMode = 0;
2667
+
2668
+ // Add event and delta to the front of the arguments
2669
+ args.unshift(event, delta, deltaX, deltaY);
2670
+
2671
+ // Clearout lowestDelta after sometime to better
2672
+ // handle multiple device types that give different
2673
+ // a different lowestDelta
2674
+ // Ex: trackpad = 3 and mouse wheel = 120
2675
+ if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
2676
+ nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
2677
+
2678
+ return ($.event.dispatch || $.event.handle).apply(this, args);
2679
+ }
2680
+
2681
+ function nullLowestDelta() {
2682
+ lowestDelta = null;
2683
+ }
2684
+
2685
+ function shouldAdjustOldDeltas(orgEvent, absDelta) {
2686
+ // If this is an older event and the delta is divisable by 120,
2687
+ // then we are assuming that the browser is treating this as an
2688
+ // older mouse wheel event and that we should divide the deltas
2689
+ // by 40 to try and get a more usable deltaFactor.
2690
+ // Side note, this actually impacts the reported scroll distance
2691
+ // in older browsers and can cause scrolling to be slower than native.
2692
+ // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
2693
+ return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
2694
+ }
2695
+
2696
+ }));
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Dateandtimepicker
3
3
  module Rails
4
- VERSION = '1.0.3'.freeze
4
+ VERSION = '1.0.4'.freeze
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-dateandtimepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksarunas