bootstrap-datepicker-rails 0.6.10 → 0.6.11

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.6.10"
3
+ VERSION = "0.6.11"
4
4
  end
5
5
  end
@@ -48,6 +48,10 @@
48
48
  } else {
49
49
  if (this.component){
50
50
  this.component.on('click', $.proxy(this.show, this));
51
+ var element = this.element.find('input');
52
+ element.on({
53
+ blur: $.proxy(this._hide, this)
54
+ })
51
55
  } else {
52
56
  this.element.on('click', $.proxy(this.show, this));
53
57
  }
@@ -76,8 +80,8 @@
76
80
  break;
77
81
  }
78
82
 
79
- this.weekStart = options.weekStart||this.element.data('date-weekstart')||dates[this.language].weekStart||0;
80
- this.weekEnd = this.weekStart == 0 ? 6 : this.weekStart - 1;
83
+ this.weekStart = ((options.weekStart||this.element.data('date-weekstart')||dates[this.language].weekStart||0) % 7);
84
+ this.weekEnd = ((this.weekStart + 6) % 7);
81
85
  this.startDate = -Infinity;
82
86
  this.endDate = Infinity;
83
87
  this.setStartDate(options.startDate||this.element.data('date-startdate'));
@@ -641,12 +645,23 @@
641
645
  }
642
646
  var parts = date ? date.match(this.nonpunctuation) : [],
643
647
  date = new Date(),
644
- val, filtered;
648
+ parsed = {},
649
+ setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
650
+ setters_map = {
651
+ yyyy: function(d,v){ return d.setFullYear(v); },
652
+ yy: function(d,v){ return d.setFullYear(2000+v); },
653
+ m: function(d,v){ return d.setMonth(v-1); },
654
+ d: function(d,v){ return d.setDate(v); },
655
+ },
656
+ val, filtered, part;
657
+ setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
658
+ setters_map['dd'] = setters_map['d'];
645
659
  date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
646
660
  if (parts.length == format.parts.length) {
647
661
  for (var i=0, cnt = format.parts.length; i < cnt; i++) {
648
662
  val = parseInt(parts[i], 10)||1;
649
- switch(format.parts[i]) {
663
+ part = format.parts[i];
664
+ switch(part) {
650
665
  case 'MM':
651
666
  filtered = $(dates[language].months).filter(function(){
652
667
  var m = this.slice(0, parts[i].length),
@@ -664,24 +679,12 @@
664
679
  val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
665
680
  break;
666
681
  }
667
- switch(format.parts[i]) {
668
- case 'dd':
669
- case 'd':
670
- date.setDate(val);
671
- break;
672
- case 'mm':
673
- case 'm':
674
- case 'MM':
675
- case 'M':
676
- date.setMonth(val - 1);
677
- break;
678
- case 'yy':
679
- date.setFullYear(2000 + val);
680
- break;
681
- case 'yyyy':
682
- date.setFullYear(val);
683
- break;
684
- }
682
+ parsed[part] = val;
683
+ }
684
+ for (var i=0, s; i<setters_order.length; i++){
685
+ s = setters_order[i];
686
+ if (s in parsed)
687
+ setters_map[s](date, parsed[s])
685
688
  }
686
689
  }
687
690
  return date;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Latvian translation for bootstrap-datepicker
3
+ * Artis Avotins <artis@apit.lv>
4
+ */
5
+
6
+ ;(function($){
7
+ $.fn.datepicker.dates['lv'] = {
8
+ days: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena", "Svētdiena"],
9
+ daysShort: ["Sv", "P", "O", "T", "C", "Pk", "S", "Sv"],
10
+ daysMin: ["Sv", "Pr", "Ot", "Tr", "Ce", "Pk", "St", "Sv"],
11
+ months: ["Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"],
12
+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jūn", "Jūl", "Aug", "Sep", "Okt", "Nov", "Dec."],
13
+ weekStart: 1
14
+ };
15
+ }(jQuery));
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Thai translation for bootstrap-datepicker
3
+ * Suchau Jiraprapot <seroz24@gmail.com>
4
+ */
5
+ ;(function($){
6
+ $.fn.datepicker.dates['th'] = {
7
+ days: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"],
8
+ daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
9
+ daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
10
+ months: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
11
+ monthsShort: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."]
12
+ };
13
+ }(jQuery));
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.6.10
4
+ version: 0.6.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-22 00:00:00.000000000 Z
12
+ date: 2012-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -85,9 +85,11 @@ files:
85
85
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.fr.js
86
86
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.is.js
87
87
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.it.js
88
+ - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.lv.js
88
89
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.nl.js
89
90
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.ru.js
90
91
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.sv.js
92
+ - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.th.js
91
93
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.tr.js
92
94
  - vendor/assets/stylesheets/bootstrap-datepicker.css
93
95
  homepage: https://github.com/Nerian/bootstrap-datepicker-rails
@@ -104,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
106
  version: '0'
105
107
  segments:
106
108
  - 0
107
- hash: -536920059827411309
109
+ hash: -3830117784439984991
108
110
  required_rubygems_version: !ruby/object:Gem::Requirement
109
111
  none: false
110
112
  requirements:
@@ -113,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
115
  version: '0'
114
116
  segments:
115
117
  - 0
116
- hash: -536920059827411309
118
+ hash: -3830117784439984991
117
119
  requirements: []
118
120
  rubyforge_project:
119
121
  rubygems_version: 1.8.21