pickadate-rails 3.5.3.0 → 3.5.4.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: 549fa9d0cc7f189eefeddc37ef4b335ba2d4f5a9
4
- data.tar.gz: e41bfd0af43ff43ee3b9c5ad9b576a090e9ec871
3
+ metadata.gz: b8c988b830fbfebffec05bc42aa384cef86b593b
4
+ data.tar.gz: b812ba0d63c6779f8ebf900c1e067b867993a08b
5
5
  SHA512:
6
- metadata.gz: 22e0243bab42931fa8cc7cc897798c84ce25a3b251d85229a1661048115476d7037cb0b141394d3c022a709efdb4e3e0ed08685637229c46c5f6d8c556f13672
7
- data.tar.gz: 72a9cf48145dc6d1ad394803c60672bd5e1dc2c63690c1ccee7d6acde2ce19e769fb4bd66c86ade40953104640105b1543524c3658a548403ac44a7e6c115f0a
6
+ metadata.gz: c6bc321378c9af93eb96ae0a26196ec4f39523ac79ce9b57989eb06ac0095cc655b3533cc55b953e86192b60fe0000e9392a8ef804fca6e0df0ebec876c53d96
7
+ data.tar.gz: 343ebb4e6b2904fbfdc934b27cf2f060c387159ca799f5b45e94671dbc11371901e09884f083dd8a6d9a5bb8e3ad832d2da2d52ef760eef917cc3615210b8557
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.3
3
+ ## Pickadate Version: 3.5.4
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.3.0"
2
+ VERSION = "3.5.4.0"
3
3
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Date picker for pickadate.js v3.5.3
3
+ * Date picker for pickadate.js v3.5.4
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( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )
105
+ targetDate = new Date( Date.UTC(highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange) )
106
106
  calendar.set(
107
107
  'highlight',
108
- [ targetDate.getFullYear(), targetDate.getMonth(), targetDate.getDate() ],
108
+ targetDate,
109
109
  { interval: timeChange }
110
110
  )
111
111
  this.render()
@@ -222,15 +222,20 @@ 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( value[ 0 ], value[ 1 ], value[ 2 ] )
225
+ value = new Date(Date.UTC(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 or date object, make a normalized date.
230
- else if ( _.isInteger( value ) || _.isDate( value ) ) {
229
+ // If it’s a number, make a normalized date.
230
+ else if ( _.isInteger( 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
+
234
239
  // If it’s a literal true or any other case, set it to now.
235
240
  else /*if ( value === true )*/ {
236
241
  value = calendar.now( type, value, options )
@@ -238,10 +243,10 @@ DatePicker.prototype.create = function( type, value, options ) {
238
243
 
239
244
  // Return the compiled object.
240
245
  return {
241
- year: isInfiniteValue || value.getFullYear(),
242
- month: isInfiniteValue || value.getMonth(),
243
- date: isInfiniteValue || value.getDate(),
244
- day: isInfiniteValue || value.getDay(),
246
+ year: isInfiniteValue || value.getUTCFullYear(),
247
+ month: isInfiniteValue || value.getUTCMonth(),
248
+ date: isInfiniteValue || value.getUTCDate(),
249
+ day: isInfiniteValue || value.getUTCDay(),
245
250
  obj: isInfiniteValue || value,
246
251
  pick: isInfiniteValue || value.getTime()
247
252
  }
@@ -316,7 +321,7 @@ DatePicker.prototype.overlapRanges = function( one, two ) {
316
321
  DatePicker.prototype.now = function( type, value, options ) {
317
322
  value = new Date()
318
323
  if ( options && options.rel ) {
319
- value.setDate( value.getDate() + options.rel )
324
+ value.setUTCDate( value.getUTCDate() + options.rel )
320
325
  }
321
326
  return this.normalize( value, options )
322
327
  }
@@ -358,13 +363,13 @@ DatePicker.prototype.navigate = function( type, value, options ) {
358
363
  }
359
364
 
360
365
  // Figure out the expected target year and month.
361
- targetDateObject = new Date( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 )
362
- targetYear = targetDateObject.getFullYear()
363
- targetMonth = targetDateObject.getMonth()
366
+ targetDateObject = new Date( Date.UTC( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 ) )
367
+ targetYear = targetDateObject.getUTCFullYear()
368
+ targetMonth = targetDateObject.getUTCMonth()
364
369
 
365
370
  // If the month we’re going to doesn’t have enough days,
366
371
  // keep decreasing the date until we reach the month’s last date.
367
- while ( /*safety &&*/ new Date( targetYear, targetMonth, targetDate ).getMonth() !== targetMonth ) {
372
+ while ( /*safety &&*/ new Date( Date.UTC( targetYear, targetMonth, targetDate ) ).getUTCMonth() !== targetMonth ) {
368
373
  targetDate -= 1
369
374
  /*safety -= 1
370
375
  if ( !safety ) {
@@ -383,7 +388,7 @@ DatePicker.prototype.navigate = function( type, value, options ) {
383
388
  * Normalize a date by setting the hours to midnight.
384
389
  */
385
390
  DatePicker.prototype.normalize = function( value/*, options*/ ) {
386
- value.setHours( 0, 0, 0, 0 )
391
+ value.setUTCHours( 0, 0, 0, 0 )
387
392
  return value
388
393
  }
389
394
 
@@ -928,7 +933,7 @@ DatePicker.prototype.activate = function( type, datesToEnable ) {
928
933
  if ( !matchFound[3] ) matchFound.push( 'inverted' )
929
934
  }
930
935
  else if ( _.isDate( unitToEnable ) ) {
931
- matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
936
+ matchFound = [ unitToEnable.getUTCFullYear(), unitToEnable.getUTCMonth(), unitToEnable.getUTCDate(), 'inverted' ]
932
937
  }
933
938
  break
934
939
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * pickadate.js v3.5.3, 2014/07/12
2
+ * pickadate.js v3.5.4, 2014/09/11
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]', function() {
687
+ on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', 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 ( targetData.nav && !targetDisabled ) {
704
+ if ( !targetDisabled && targetData.nav ) {
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 ( PickerConstructor._.isInteger( targetData.pick ) && !targetDisabled ) {
709
+ else if ( !targetDisabled && 'pick' in targetData ) {
710
710
  P.set( 'select', targetData.pick ).close( true )
711
711
  }
712
712
 
@@ -714,9 +714,11 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
714
714
  else if ( targetData.clear ) {
715
715
  P.clear().close( true )
716
716
  }
717
- })
718
- .on('click', '[data-close]', function () {
719
- P.close(true);
717
+
718
+ else if ( targetData.close ) {
719
+ P.close( true )
720
+ }
721
+
720
722
  }) //P.$root
721
723
 
722
724
  aria( P.$root[0], 'hidden', true )
@@ -749,9 +751,6 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
749
751
  // Create the name using the original input’s with a prefix and suffix.
750
752
  'name="' + name + '"' +
751
753
 
752
- // Create the ID using the original input’s; only if it has one.
753
- (ELEMENT.id ? 'id="' + ELEMENT.id + '_hidden"' : '') +
754
-
755
754
  // If the element has a value, set the hidden value as well.
756
755
  (
757
756
  $ELEMENT.data('value') || ELEMENT.value ?
@@ -979,7 +978,7 @@ PickerConstructor._ = {
979
978
  * Tell if something is a date object.
980
979
  */
981
980
  isDate: function( value ) {
982
- return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getDate() )
981
+ return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getUTCDate() )
983
982
  },
984
983
 
985
984
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Time picker for pickadate.js v3.5.3
3
+ * Time picker for pickadate.js v3.5.4
4
4
  * http://amsul.github.io/pickadate.js/time.htm
5
5
  */
6
6
 
@@ -7,6 +7,7 @@ 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',
10
11
  firstDay: 1,
11
12
  format: 'dddd d !de mmmm !de yyyy',
12
13
  formatSubmit: 'yyyy/mm/dd'
@@ -7,6 +7,7 @@ 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',
10
11
  firstDay: 1,
11
12
  format: 'dd mmmm yyyy',
12
13
  formatSubmit: 'yyyy/mm/dd',
@@ -5,8 +5,9 @@ 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',
8
+ today: 'Oggi',
9
+ clear: 'Cancellare',
10
+ close: 'Chiudi',
10
11
  firstDay: 1,
11
12
  format: 'dddd d mmmm yyyy',
12
13
  formatSubmit: 'yyyy/mm/dd'
@@ -1,12 +1,13 @@
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: 'закрыть',
10
11
  firstDay: 1,
11
12
  format: 'd mmmm yyyy г.',
12
13
  formatSubmit: 'yyyy/mm/dd'
@@ -2,11 +2,12 @@
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: [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII' ],
6
- weekdaysFull: [ 'nedeļľa', 'pondelok', 'utorok', 'streda', 'š̌švrtok', 'piatok', 'sobota' ],
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' ],
7
7
  weekdaysShort: [ 'Ne', 'Po', 'Ut', 'St', 'Št', 'Pi', 'So' ],
8
8
  today: 'dnes',
9
9
  clear: 'vymazať',
10
+ close: 'zavrieť',
10
11
  firstDay: 1,
11
12
  format: 'd. mmmm yyyy',
12
13
  formatSubmit: 'yyyy/mm/dd'
@@ -98,6 +98,7 @@
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;
101
102
  }
102
103
 
103
104
  /* ==========================================================================
@@ -98,6 +98,7 @@
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;
101
102
  }
102
103
 
103
104
  /* ==========================================================================
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.3.0
4
+ version: 3.5.4.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-07-25 00:00:00.000000000 Z
11
+ date: 2014-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties