bootstrap-datepicker-rails 1.6.0.1 → 1.6.1

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: d8ea69a31680699e3b39c3dc77d7e6ceaf5b9283
4
- data.tar.gz: de36a085effa3ed272666b488fad6236a626368e
3
+ metadata.gz: f3315ac0809efcae33b35a5a6407b71982e82aa9
4
+ data.tar.gz: 740c47e4ff98ab1caaa26f7c349d7e2324d65a5a
5
5
  SHA512:
6
- metadata.gz: 924d5d2577ac4b7f15c63245d3cc6d7ccadd9318148cc334da8ace5e822441fd818ca2ddbcbf7916419a617707c53eda4c8cfc63b60285f29c43aa69b4e6589f
7
- data.tar.gz: 382f41cfc840d87cbda3843f24050c6c8b9c2e2883af220138553c519adc51ea80172c32f224b72f6a87662c2bfa5c1f94d2e4b3d08d61f8d5f44e8ad6f364fa
6
+ metadata.gz: 89382f1bac33620dee164027de2542a1574da01a7ea6d3ee75f585ff36c439e4c5084096448c1f184a0a7eb40a7e6888244afb311c97be0447ff1f79498f19ac
7
+ data.tar.gz: ddacb146a8c9a6b025224deb2200a50fb43d064f2bd05abab477e08dc14706aaa79127305517050075d59939f107111f83a4823a1f2b249efa9cfd08c4399cf4
@@ -1,5 +1,5 @@
1
1
  module BootstrapDatepickerRails
2
2
  module Rails
3
- VERSION = "1.6.0.1"
3
+ VERSION = "1.6.1"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Datepicker for Bootstrap v1.6.0 (https://github.com/eternicode/bootstrap-datepicker)
2
+ * Datepicker for Bootstrap v1.6.1 (https://github.com/eternicode/bootstrap-datepicker)
3
3
  *
4
4
  * Copyright 2012 Stefan Petre
5
5
  * Improvements by Andrew Rowls
@@ -92,12 +92,13 @@
92
92
  this.focusDate = null;
93
93
 
94
94
  this.element = $(element);
95
- this.isInline = false;
96
95
  this.isInput = this.element.is('input');
96
+ this.inputField = this.isInput ? this.element : this.element.find('input');
97
97
  this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;
98
- this.hasInput = this.component && this.element.find('input').length;
98
+ this.hasInput = this.component && this.inputField.length;
99
99
  if (this.component && this.component.length === 0)
100
100
  this.component = false;
101
+ this.isInline = !this.component && this.element.is('div');
101
102
 
102
103
  this.picker = $(DPGlobal.template);
103
104
 
@@ -269,9 +270,9 @@
269
270
 
270
271
  o.datesDisabled = o.datesDisabled||[];
271
272
  if (!$.isArray(o.datesDisabled)) {
272
- var datesDisabled = [];
273
- datesDisabled.push(DPGlobal.parseDate(o.datesDisabled, format, o.language, o.assumeNearbyYear));
274
- o.datesDisabled = datesDisabled;
273
+ o.datesDisabled = [
274
+ o.datesDisabled
275
+ ];
275
276
  }
276
277
  o.datesDisabled = $.map(o.datesDisabled,function(d){
277
278
  return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);
@@ -369,19 +370,17 @@
369
370
  else if (this.component && this.hasInput) { // component: input + button
370
371
  this._events = [
371
372
  // For components that are not readonly, allow keyboard nav
372
- [this.element.find('input'), events],
373
+ [this.inputField, events],
373
374
  [this.component, {
374
375
  click: $.proxy(this.show, this)
375
376
  }]
376
377
  ];
377
378
  }
378
- else if (this.element.is('div')){ // inline datepicker
379
- this.isInline = true;
380
- }
381
379
  else {
382
380
  this._events = [
383
381
  [this.element, {
384
- click: $.proxy(this.show, this)
382
+ click: $.proxy(this.show, this),
383
+ keydown: $.proxy(this.keydown, this)
385
384
  }]
386
385
  ];
387
386
  }
@@ -424,7 +423,7 @@
424
423
  this.element.find(e.target).length ||
425
424
  this.picker.is(e.target) ||
426
425
  this.picker.find(e.target).length ||
427
- this.picker.hasClass('datepicker-inline')
426
+ this.isInline
428
427
  )){
429
428
  this.hide();
430
429
  }
@@ -471,8 +470,7 @@
471
470
  },
472
471
 
473
472
  show: function(){
474
- var element = this.component ? this.element.find('input') : this.element;
475
- if (element.attr('readonly') && this.o.enableOnReadonly === false)
473
+ if (this.inputField.prop('disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false))
476
474
  return;
477
475
  if (!this.isInline)
478
476
  this.picker.appendTo(this.o.container);
@@ -487,9 +485,7 @@
487
485
  },
488
486
 
489
487
  hide: function(){
490
- if (this.isInline)
491
- return this;
492
- if (!this.picker.is(':visible'))
488
+ if (this.isInline || !this.picker.is(':visible'))
493
489
  return this;
494
490
  this.focusDate = null;
495
491
  this.picker.hide().detach();
@@ -497,13 +493,7 @@
497
493
  this.viewMode = this.o.startView;
498
494
  this.showMode();
499
495
 
500
- if (
501
- this.o.forceParse &&
502
- (
503
- this.isInput && this.element.val() ||
504
- this.hasInput && this.element.find('input').val()
505
- )
506
- )
496
+ if (this.o.forceParse && this.inputField.val())
507
497
  this.setValue();
508
498
  this._trigger('hide');
509
499
  return this;
@@ -575,15 +565,8 @@
575
565
  },
576
566
 
577
567
  clearDates: function(){
578
- var element;
579
- if (this.isInput) {
580
- element = this.element;
581
- } else if (this.component) {
582
- element = this.element.find('input');
583
- }
584
-
585
- if (element) {
586
- element.val('');
568
+ if (this.inputField) {
569
+ this.inputField.val('');
587
570
  }
588
571
 
589
572
  this.update();
@@ -615,14 +598,7 @@
615
598
 
616
599
  setValue: function(){
617
600
  var formatted = this.getFormattedDate();
618
- if (!this.isInput){
619
- if (this.component){
620
- this.element.find('input').val(formatted);
621
- }
622
- }
623
- else {
624
- this.element.val(formatted);
625
- }
601
+ this.inputField.val(formatted);
626
602
  return this;
627
603
  },
628
604
 
@@ -782,7 +758,7 @@
782
758
  else {
783
759
  dates = this.isInput
784
760
  ? this.element.val()
785
- : this.element.data('date') || this.element.find('input').val();
761
+ : this.element.data('date') || this.inputField.val();
786
762
  if (dates && this.o.multidate)
787
763
  dates = dates.split(this.o.multidateSeparator);
788
764
  else
@@ -890,9 +866,12 @@
890
866
  }
891
867
  if (this.dates.contains(date) !== -1)
892
868
  cls.push('active');
893
- if (!this.dateWithinRange(date) || this.dateIsDisabled(date)){
869
+ if (!this.dateWithinRange(date)){
894
870
  cls.push('disabled');
895
871
  }
872
+ if (this.dateIsDisabled(date)){
873
+ cls.push('disabled', 'disabled-date');
874
+ }
896
875
  if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){
897
876
  cls.push('highlighted');
898
877
  }
@@ -1030,7 +1009,6 @@
1030
1009
  // Calendar week: ms between thursdays, div ms per day, div 7 days
1031
1010
  calWeek = (th - yth) / 864e5 / 7 + 1;
1032
1011
  html.push('<td class="cw">'+ calWeek +'</td>');
1033
-
1034
1012
  }
1035
1013
  }
1036
1014
  clsName = this.getClassNames(prevMonth);
@@ -1212,7 +1190,7 @@
1212
1190
  }
1213
1191
 
1214
1192
  // Clicked on today button
1215
- if (target.hasClass('today')){
1193
+ if (target.hasClass('today') && !target.hasClass('day')){
1216
1194
  this.showMode(-2);
1217
1195
  this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view');
1218
1196
  }
@@ -1355,15 +1333,8 @@
1355
1333
  if (!which || which !== 'view') {
1356
1334
  this._trigger('changeDate');
1357
1335
  }
1358
- var element;
1359
- if (this.isInput){
1360
- element = this.element;
1361
- }
1362
- else if (this.component){
1363
- element = this.element.find('input');
1364
- }
1365
- if (element){
1366
- element.change();
1336
+ if (this.inputField){
1337
+ this.inputField.change();
1367
1338
  }
1368
1339
  if (this.o.autoclose && (!which || which === 'date')){
1369
1340
  this.hide();
@@ -1564,15 +1535,8 @@
1564
1535
  this._trigger('changeDate');
1565
1536
  else
1566
1537
  this._trigger('clearDate');
1567
- var element;
1568
- if (this.isInput){
1569
- element = this.element;
1570
- }
1571
- else if (this.component){
1572
- element = this.element.find('input');
1573
- }
1574
- if (element){
1575
- element.change();
1538
+ if (this.inputField){
1539
+ this.inputField.change();
1576
1540
  }
1577
1541
  }
1578
1542
  },
@@ -2052,7 +2016,7 @@
2052
2016
  };
2053
2017
  DPGlobal.template = '<div class="datepicker">'+
2054
2018
  '<div class="datepicker-days">'+
2055
- '<table class=" table-condensed">'+
2019
+ '<table class="table-condensed">'+
2056
2020
  DPGlobal.headTemplate+
2057
2021
  '<tbody></tbody>'+
2058
2022
  DPGlobal.footTemplate+
@@ -2101,7 +2065,7 @@
2101
2065
 
2102
2066
  /* DATEPICKER VERSION
2103
2067
  * =================== */
2104
- $.fn.datepicker.version = '1.6.0';
2068
+ $.fn.datepicker.version = '1.6.1';
2105
2069
 
2106
2070
  /* DATEPICKER DATA-API
2107
2071
  * ================== */
@@ -8,7 +8,7 @@
8
8
  daysShort: ["Жек", "Дүй", "Сей", "Сәр", "Бей", "Жұм", "Сен"],
9
9
  daysMin: ["Жк", "Дс", "Сс", "Ср", "Бс", "Жм", "Сн"],
10
10
  months: ["Қаңтар", "Ақпан", "Наурыз", "Сәуір", "Мамыр", "Маусым", "Шілде", "Тамыз", "Қыркүйек", "Қазан", "Қараша", "Желтоқсан"],
11
- monthsShort: ["Қаң", "Ақп", "Нау", "Сәу", "Мамыр", "Мау", "Шлд", "Тмз", "Қыр", "Қзн", "Қар", "Жел"],
11
+ monthsShort: ["Қаң", "Ақп", "Нау", "Сәу", "Мам", "Мау", "Шіл", "Там", "Қыр", "Қаз", "Қар", "Жел"],
12
12
  today: "Бүгін",
13
13
  weekStart: 1
14
14
  };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Datepicker for Bootstrap v1.6.0 (https://github.com/eternicode/bootstrap-datepicker)
2
+ * Datepicker for Bootstrap v1.6.1 (https://github.com/eternicode/bootstrap-datepicker)
3
3
  *
4
4
  * Copyright 2012 Stefan Petre
5
5
  * Improvements by Andrew Rowls
@@ -470,4 +470,5 @@
470
470
  border: 1px solid #ccc;
471
471
  margin-left: -5px;
472
472
  margin-right: -5px;
473
- }
473
+ }
474
+ /*# sourceMappingURL=bootstrap-datepicker.css.map */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Datepicker for Bootstrap v1.6.0 (https://github.com/eternicode/bootstrap-datepicker)
2
+ * Datepicker for Bootstrap v1.6.1 (https://github.com/eternicode/bootstrap-datepicker)
3
3
  *
4
4
  * Copyright 2012 Stefan Petre
5
5
  * Improvements by Andrew Rowls
@@ -677,4 +677,5 @@ fieldset[disabled] .datepicker table tr td span.active.disabled:hover.focus {
677
677
  border-width: 1px 0;
678
678
  margin-left: -5px;
679
679
  margin-right: -5px;
680
- }
680
+ }
681
+ /*# sourceMappingURL=bootstrap-datepicker3.css.map */
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-datepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0.1
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo Rodríguez-Baltanás Díaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-14 00:00:00.000000000 Z
11
+ date: 2016-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties