pickadate-rails 3.5.4.0 → 3.5.5.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: b8c988b830fbfebffec05bc42aa384cef86b593b
4
- data.tar.gz: b812ba0d63c6779f8ebf900c1e067b867993a08b
3
+ metadata.gz: 71f85c73882c8868e11fc979a535a49ed0e9cf51
4
+ data.tar.gz: 887c27301050e47bc7e418e715ab36741d8b6632
5
5
  SHA512:
6
- metadata.gz: c6bc321378c9af93eb96ae0a26196ec4f39523ac79ce9b57989eb06ac0095cc655b3533cc55b953e86192b60fe0000e9392a8ef804fca6e0df0ebec876c53d96
7
- data.tar.gz: 343ebb4e6b2904fbfdc934b27cf2f060c387159ca799f5b45e94671dbc11371901e09884f083dd8a6d9a5bb8e3ad832d2da2d52ef760eef917cc3615210b8557
6
+ metadata.gz: 58bb5aa19b5e32deabc967af127498d3f77ce64911328dd1ffb107445d8fa3d93d1c8e49d178af48e9d88e4f2ff4c3424777428d80c895c80bff4117a5a9e399
7
+ data.tar.gz: 8db797f6ad25dd499d114578d4fa7780fa83137196cc05328032f2aa6bd2e12f6b5adbb765d4b2514f5def11021e85e2729753d39da33c4dc7e1ba11dadfe715
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pickadate-Rails [![Gem Version](https://badge.fury.io/rb/pickadate-rails.png)](http://badge.fury.io/rb/pickadate-rails)
2
2
 
3
- ## Pickadate Version: 3.5.4
3
+ ## Pickadate Version: 3.5.5
4
4
 
5
5
  Easily add [pickadate.js](https://github.com/amsul/pickadate.js) to your Rails 3.1+ application using the asset pipeline.
6
6
 
@@ -1,3 +1,3 @@
1
1
  module PickadateRails
2
- VERSION = "3.5.4.0"
2
+ VERSION = "3.5.5.0"
3
3
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Date picker for pickadate.js v3.5.4
3
+ * Date picker for pickadate.js v3.5.3
4
4
  * http://amsul.github.io/pickadate.js/date.htm
5
5
  */
6
6
 
@@ -102,10 +102,10 @@ function DatePicker( picker, settings ) {
102
102
  37: function() { return isRTL() ? 1 : -1 }, // Left
103
103
  go: function( timeChange ) {
104
104
  var highlightedObject = calendar.item.highlight,
105
- targetDate = new Date( Date.UTC(highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange) )
105
+ targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )
106
106
  calendar.set(
107
107
  'highlight',
108
- targetDate,
108
+ [ targetDate.getFullYear(), targetDate.getMonth(), targetDate.getDate() ],
109
109
  { interval: timeChange }
110
110
  )
111
111
  this.render()
@@ -222,20 +222,15 @@ DatePicker.prototype.create = function( type, value, options ) {
222
222
  // If it’s an array, convert it into a date and make sure
223
223
  // that it’s a valid date – otherwise default to today.
224
224
  else if ( $.isArray( value ) ) {
225
- value = new Date(Date.UTC(value[ 0 ], value[ 1 ], value[ 2 ] ))
225
+ value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] )
226
226
  value = _.isDate( value ) ? value : calendar.create().obj
227
227
  }
228
228
 
229
- // If it’s a number, make a normalized date.
230
- else if ( _.isInteger( value ) ) {
229
+ // If it’s a number or date object, make a normalized date.
230
+ else if ( _.isInteger( value ) || _.isDate( value ) ) {
231
231
  value = calendar.normalize( new Date( value ), options )
232
232
  }
233
233
 
234
- // If it’s a date object, make a normalized date.
235
- else if ( _.isDate( value ) ) {
236
- value = calendar.normalize( value, options )
237
- }
238
-
239
234
  // If it’s a literal true or any other case, set it to now.
240
235
  else /*if ( value === true )*/ {
241
236
  value = calendar.now( type, value, options )
@@ -243,10 +238,10 @@ DatePicker.prototype.create = function( type, value, options ) {
243
238
 
244
239
  // Return the compiled object.
245
240
  return {
246
- year: isInfiniteValue || value.getUTCFullYear(),
247
- month: isInfiniteValue || value.getUTCMonth(),
248
- date: isInfiniteValue || value.getUTCDate(),
249
- day: isInfiniteValue || value.getUTCDay(),
241
+ year: isInfiniteValue || value.getFullYear(),
242
+ month: isInfiniteValue || value.getMonth(),
243
+ date: isInfiniteValue || value.getDate(),
244
+ day: isInfiniteValue || value.getDay(),
250
245
  obj: isInfiniteValue || value,
251
246
  pick: isInfiniteValue || value.getTime()
252
247
  }
@@ -321,7 +316,7 @@ DatePicker.prototype.overlapRanges = function( one, two ) {
321
316
  DatePicker.prototype.now = function( type, value, options ) {
322
317
  value = new Date()
323
318
  if ( options && options.rel ) {
324
- value.setUTCDate( value.getUTCDate() + options.rel )
319
+ value.setDate( value.getDate() + options.rel )
325
320
  }
326
321
  return this.normalize( value, options )
327
322
  }
@@ -363,13 +358,13 @@ DatePicker.prototype.navigate = function( type, value, options ) {
363
358
  }
364
359
 
365
360
  // Figure out the expected target year and month.
366
- targetDateObject = new Date( Date.UTC( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 ) )
367
- targetYear = targetDateObject.getUTCFullYear()
368
- targetMonth = targetDateObject.getUTCMonth()
361
+ targetDateObject = new Date( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 )
362
+ targetYear = targetDateObject.getFullYear()
363
+ targetMonth = targetDateObject.getMonth()
369
364
 
370
365
  // If the month we’re going to doesn’t have enough days,
371
366
  // keep decreasing the date until we reach the month’s last date.
372
- while ( /*safety &&*/ new Date( Date.UTC( targetYear, targetMonth, targetDate ) ).getUTCMonth() !== targetMonth ) {
367
+ while ( /*safety &&*/ new Date( targetYear, targetMonth, targetDate ).getMonth() !== targetMonth ) {
373
368
  targetDate -= 1
374
369
  /*safety -= 1
375
370
  if ( !safety ) {
@@ -388,7 +383,7 @@ DatePicker.prototype.navigate = function( type, value, options ) {
388
383
  * Normalize a date by setting the hours to midnight.
389
384
  */
390
385
  DatePicker.prototype.normalize = function( value/*, options*/ ) {
391
- value.setUTCHours( 0, 0, 0, 0 )
386
+ value.setHours( 0, 0, 0, 0 )
392
387
  return value
393
388
  }
394
389
 
@@ -933,7 +928,7 @@ DatePicker.prototype.activate = function( type, datesToEnable ) {
933
928
  if ( !matchFound[3] ) matchFound.push( 'inverted' )
934
929
  }
935
930
  else if ( _.isDate( unitToEnable ) ) {
936
- matchFound = [ unitToEnable.getUTCFullYear(), unitToEnable.getUTCMonth(), unitToEnable.getUTCDate(), 'inverted' ]
931
+ matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
937
932
  }
938
933
  break
939
934
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * pickadate.js v3.5.4, 2014/09/11
2
+ * pickadate.js v3.5.3, 2014/07/12
3
3
  * By Amsul, http://amsul.ca
4
4
  * Hosted on http://amsul.github.io/pickadate.js
5
5
  * Licensed under MIT
@@ -684,7 +684,7 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
684
684
  }).
685
685
 
686
686
  // If there’s a click on an actionable element, carry out the actions.
687
- on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {
687
+ on( 'click', '[data-pick], [data-nav], [data-clear]', function() {
688
688
 
689
689
  var $target = $( this ),
690
690
  targetData = $target.data(),
@@ -701,12 +701,12 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
701
701
  }
702
702
 
703
703
  // If something is superficially changed, update the `highlight` based on the `nav`.
704
- if ( !targetDisabled && targetData.nav ) {
704
+ if ( targetData.nav && !targetDisabled ) {
705
705
  P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )
706
706
  }
707
707
 
708
708
  // If something is picked, set `select` then close with focus.
709
- else if ( !targetDisabled && 'pick' in targetData ) {
709
+ else if ( PickerConstructor._.isInteger( targetData.pick ) && !targetDisabled ) {
710
710
  P.set( 'select', targetData.pick ).close( true )
711
711
  }
712
712
 
@@ -714,11 +714,9 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
714
714
  else if ( targetData.clear ) {
715
715
  P.clear().close( true )
716
716
  }
717
-
718
- else if ( targetData.close ) {
719
- P.close( true )
720
- }
721
-
717
+ })
718
+ .on('click', '[data-close]', function () {
719
+ P.close(true);
722
720
  }) //P.$root
723
721
 
724
722
  aria( P.$root[0], 'hidden', true )
@@ -751,6 +749,9 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
751
749
  // Create the name using the original input’s with a prefix and suffix.
752
750
  'name="' + name + '"' +
753
751
 
752
+ // Create the ID using the original input’s; only if it has one.
753
+ (ELEMENT.id ? 'id="' + ELEMENT.id + '_hidden"' : '') +
754
+
754
755
  // If the element has a value, set the hidden value as well.
755
756
  (
756
757
  $ELEMENT.data('value') || ELEMENT.value ?
@@ -978,7 +979,7 @@ PickerConstructor._ = {
978
979
  * Tell if something is a date object.
979
980
  */
980
981
  isDate: function( value ) {
981
- return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getUTCDate() )
982
+ return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getDate() )
982
983
  },
983
984
 
984
985
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Time picker for pickadate.js v3.5.4
3
+ * Time picker for pickadate.js v3.5.3
4
4
  * http://amsul.github.io/pickadate.js/time.htm
5
5
  */
6
6
 
@@ -7,7 +7,6 @@ jQuery.extend( jQuery.fn.pickadate.defaults, {
7
7
  weekdaysShort: [ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb' ],
8
8
  today: 'hoy',
9
9
  clear: 'borrar',
10
- close: 'cerrar',
11
10
  firstDay: 1,
12
11
  format: 'dddd d !de mmmm !de yyyy',
13
12
  formatSubmit: 'yyyy/mm/dd'
@@ -7,7 +7,6 @@ jQuery.extend( jQuery.fn.pickadate.defaults, {
7
7
  weekdaysShort: [ 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam' ],
8
8
  today: 'Aujourd\'hui',
9
9
  clear: 'Effacer',
10
- close: 'Fermer',
11
10
  firstDay: 1,
12
11
  format: 'dd mmmm yyyy',
13
12
  formatSubmit: 'yyyy/mm/dd',
@@ -5,9 +5,8 @@ jQuery.extend( jQuery.fn.pickadate.defaults, {
5
5
  monthsShort: [ 'gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic' ],
6
6
  weekdaysFull: [ 'domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato' ],
7
7
  weekdaysShort: [ 'dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab' ],
8
- today: 'Oggi',
9
- clear: 'Cancellare',
10
- close: 'Chiudi',
8
+ today: 'oggi',
9
+ clear: 'cancellare',
11
10
  firstDay: 1,
12
11
  format: 'dddd d mmmm yyyy',
13
12
  formatSubmit: 'yyyy/mm/dd'
@@ -1,13 +1,12 @@
1
1
  // Russian
2
2
 
3
3
  jQuery.extend( jQuery.fn.pickadate.defaults, {
4
- monthsFull: [ 'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря' ],
5
- monthsShort: [ 'янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек' ],
4
+ monthsFull: [ 'Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря' ],
5
+ monthsShort: [ 'Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек' ],
6
6
  weekdaysFull: [ 'воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота' ],
7
7
  weekdaysShort: [ 'вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб' ],
8
8
  today: 'сегодня',
9
9
  clear: 'удалить',
10
- close: 'закрыть',
11
10
  firstDay: 1,
12
11
  format: 'd mmmm yyyy г.',
13
12
  formatSubmit: 'yyyy/mm/dd'
@@ -2,12 +2,11 @@
2
2
 
3
3
  jQuery.extend( jQuery.fn.pickadate.defaults, {
4
4
  monthsFull: [ 'január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december' ],
5
- monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec' ],
6
- weekdaysFull: [ 'nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota' ],
5
+ monthsShort: [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII' ],
6
+ weekdaysFull: [ 'nedeļľa', 'pondelok', 'utorok', 'streda', 'š̌švrtok', 'piatok', 'sobota' ],
7
7
  weekdaysShort: [ 'Ne', 'Po', 'Ut', 'St', 'Št', 'Pi', 'So' ],
8
8
  today: 'dnes',
9
9
  clear: 'vymazať',
10
- close: 'zavrieť',
11
10
  firstDay: 1,
12
11
  format: 'd. mmmm yyyy',
13
12
  formatSubmit: 'yyyy/mm/dd'
@@ -98,7 +98,6 @@
98
98
  .picker--time .picker__button--clear:hover:before,
99
99
  .picker--time .picker__button--clear:focus:before {
100
100
  color: #ffffff;
101
- border-color: #ffffff;
102
101
  }
103
102
 
104
103
  /* ==========================================================================
@@ -98,7 +98,6 @@
98
98
  .picker--time .picker__button--clear:hover:before,
99
99
  .picker--time .picker__button--clear:focus:before {
100
100
  color: #ffffff;
101
- border-color: #ffffff;
102
101
  }
103
102
 
104
103
  /* ==========================================================================
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickadate-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.4.0
4
+ version: 3.5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Fraser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-03 00:00:00.000000000 Z
11
+ date: 2014-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties