bootstrap-datepicker-rails 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module BootstrapDatepickerRails
2
2
  module Rails
3
- VERSION = "0.5.1"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /* =========================================================
2
- * bootstrap-datepicker.js
2
+ * bootstrap-datepicker.js
3
3
  * http://www.eyecon.ro/bootstrap-datepicker
4
4
  * =========================================================
5
5
  * Copyright 2012 Stefan Petre
@@ -17,11 +17,11 @@
17
17
  * See the License for the specific language governing permissions and
18
18
  * limitations under the License.
19
19
  * ========================================================= */
20
-
20
+
21
21
  !function( $ ) {
22
-
22
+
23
23
  // Picker object
24
-
24
+
25
25
  var Datepicker = function(element, options){
26
26
  this.element = $(element);
27
27
  this.language = options.language in dates ? options.language : "en";
@@ -34,7 +34,7 @@
34
34
  });
35
35
  this.isInput = this.element.is('input');
36
36
  this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
37
-
37
+
38
38
  if (this.isInput) {
39
39
  this.element.on({
40
40
  focus: $.proxy(this.show, this),
@@ -69,7 +69,7 @@
69
69
  this.update();
70
70
  this.showMode();
71
71
  };
72
-
72
+
73
73
  Datepicker.prototype = {
74
74
  constructor: Datepicker,
75
75
 
@@ -97,25 +97,25 @@
97
97
  // event triggers a hide before the click event can stop propagation.
98
98
  if ($.browser.msie) {
99
99
  var t = this, args = arguments;
100
-
100
+
101
101
  function cancel_hide(){
102
102
  clearTimeout(hide_timeout);
103
103
  e.target.focus();
104
104
  t.picker.off('click', cancel_hide);
105
105
  }
106
-
106
+
107
107
  function do_hide(){
108
108
  t.hide.apply(t, args);
109
109
  t.picker.off('click', cancel_hide);
110
110
  }
111
-
111
+
112
112
  this.picker.on('click', cancel_hide);
113
113
  var hide_timeout = setTimeout(do_hide, 100);
114
114
  } else {
115
115
  return this.hide.apply(this, arguments);
116
116
  }
117
117
  },
118
-
118
+
119
119
  hide: function(e){
120
120
  this.picker.hide();
121
121
  $(window).off('resize', this.place);
@@ -131,7 +131,7 @@
131
131
  date: this.date
132
132
  });
133
133
  },
134
-
134
+
135
135
  setValue: function() {
136
136
  var formated = DPGlobal.formatDate(this.date, this.format, this.language);
137
137
  if (!this.isInput) {
@@ -143,7 +143,7 @@
143
143
  this.element.prop('value', formated);
144
144
  }
145
145
  },
146
-
146
+
147
147
  setStartDate: function(startDate){
148
148
  this.startDate = startDate||-Infinity;
149
149
  if (this.startDate !== -Infinity) {
@@ -152,7 +152,7 @@
152
152
  this.update();
153
153
  this.updateNavArrows();
154
154
  },
155
-
155
+
156
156
  setEndDate: function(endDate){
157
157
  this.endDate = endDate||Infinity;
158
158
  if (this.endDate !== Infinity) {
@@ -161,7 +161,7 @@
161
161
  this.update();
162
162
  this.updateNavArrows();
163
163
  },
164
-
164
+
165
165
  place: function(){
166
166
  var offset = this.component ? this.component.offset() : this.element.offset();
167
167
  this.picker.css({
@@ -169,7 +169,7 @@
169
169
  left: offset.left
170
170
  });
171
171
  },
172
-
172
+
173
173
  update: function(){
174
174
  this.date = DPGlobal.parseDate(
175
175
  this.isInput ? this.element.prop('value') : this.element.data('date'),
@@ -184,7 +184,7 @@
184
184
  }
185
185
  this.fill();
186
186
  },
187
-
187
+
188
188
  fillDow: function(){
189
189
  var dowCnt = this.weekStart;
190
190
  var html = '<tr>';
@@ -194,7 +194,7 @@
194
194
  html += '</tr>';
195
195
  this.picker.find('.datepicker-days thead').append(html);
196
196
  },
197
-
197
+
198
198
  fillMonths: function(){
199
199
  var html = '';
200
200
  var i = 0
@@ -203,7 +203,7 @@
203
203
  }
204
204
  this.picker.find('.datepicker-months td').html(html);
205
205
  },
206
-
206
+
207
207
  fill: function() {
208
208
  var d = new Date(this.viewDate),
209
209
  year = d.getFullYear(),
@@ -250,7 +250,7 @@
250
250
  }
251
251
  this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
252
252
  var currentYear = this.date.getFullYear();
253
-
253
+
254
254
  var months = this.picker.find('.datepicker-months')
255
255
  .find('th:eq(1)')
256
256
  .text(year)
@@ -316,7 +316,7 @@
316
316
  break;
317
317
  }
318
318
  },
319
-
319
+
320
320
  click: function(e) {
321
321
  e.stopPropagation();
322
322
  e.preventDefault();
@@ -332,7 +332,7 @@
332
332
  case 'next':
333
333
  this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
334
334
  this.viewDate,
335
- this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
335
+ this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
336
336
  DPGlobal.modes[this.viewMode].navStep * (target[0].className == 'prev' ? -1 : 1)
337
337
  );
338
338
  this.fill();
@@ -397,7 +397,7 @@
397
397
  }
398
398
  }
399
399
  },
400
-
400
+
401
401
  mousedown: function(e){
402
402
  e.stopPropagation();
403
403
  e.preventDefault();
@@ -499,7 +499,7 @@
499
499
  break;
500
500
  }
501
501
  },
502
-
502
+
503
503
  showMode: function(dir) {
504
504
  if (dir) {
505
505
  this.viewMode = Math.max(0, Math.min(2, this.viewMode + dir));
@@ -508,7 +508,7 @@
508
508
  this.updateNavArrows();
509
509
  }
510
510
  };
511
-
511
+
512
512
  $.fn.datepicker = function ( option ) {
513
513
  var args = Array.apply(null, arguments);
514
514
  args.shift();
@@ -540,6 +540,20 @@
540
540
  daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
541
541
  months: ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
542
542
  monthsShort: ["Jan", "Feb", "M\xe4r", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]
543
+ },
544
+ br: {
545
+ days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"],
546
+ daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],
547
+ daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
548
+ months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
549
+ monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"]
550
+ },
551
+ es: {
552
+ days: ["Domingo", "Lunes", "Martes", "Mi\xE9rcoles", "Jueves", "Viernes", "Sábado", "Domingo"],
553
+ daysShort: ["Dom", "Lun", "Mar", "Mi\xE9", "Jue", "Vie", "Sáb", "Dom"],
554
+ daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"],
555
+ months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
556
+ monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"]
543
557
  }
544
558
  }
545
559
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-datepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  segments:
94
94
  - 0
95
- hash: 3212205110107691319
95
+ hash: 3117334614881768378
96
96
  required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  segments:
103
103
  - 0
104
- hash: 3212205110107691319
104
+ hash: 3117334614881768378
105
105
  requirements: []
106
106
  rubyforge_project:
107
107
  rubygems_version: 1.8.19