bootstrap-datepicker-rails 0.6.14 → 0.6.15

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.14"
3
+ VERSION = "0.6.15"
4
4
  end
5
5
  end
@@ -661,6 +661,8 @@
661
661
  yy: function(d,v){ return d.setFullYear(2000+v); },
662
662
  m: function(d,v){
663
663
  v -= 1;
664
+ while (v<0) v += 12;
665
+ v %= 12;
664
666
  d.setMonth(v);
665
667
  while (d.getMonth() != v)
666
668
  d.setDate(d.getDate()-1);
@@ -674,25 +676,27 @@
674
676
  date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
675
677
  if (parts.length == format.parts.length) {
676
678
  for (var i=0, cnt = format.parts.length; i < cnt; i++) {
677
- val = parseInt(parts[i], 10)||1;
679
+ val = parseInt(parts[i], 10);
678
680
  part = format.parts[i];
679
- switch(part) {
680
- case 'MM':
681
- filtered = $(dates[language].months).filter(function(){
682
- var m = this.slice(0, parts[i].length),
683
- p = parts[i].slice(0, m.length);
684
- return m == p;
685
- });
686
- val = $.inArray(filtered[0], dates[language].months) + 1;
687
- break;
688
- case 'M':
689
- filtered = $(dates[language].monthsShort).filter(function(){
690
- var m = this.slice(0, parts[i].length),
691
- p = parts[i].slice(0, m.length);
692
- return m == p;
693
- });
694
- val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
695
- break;
681
+ if (isNaN(val)) {
682
+ switch(part) {
683
+ case 'MM':
684
+ filtered = $(dates[language].months).filter(function(){
685
+ var m = this.slice(0, parts[i].length),
686
+ p = parts[i].slice(0, m.length);
687
+ return m == p;
688
+ });
689
+ val = $.inArray(filtered[0], dates[language].months) + 1;
690
+ break;
691
+ case 'M':
692
+ filtered = $(dates[language].monthsShort).filter(function(){
693
+ var m = this.slice(0, parts[i].length),
694
+ p = parts[i].slice(0, m.length);
695
+ return m == p;
696
+ });
697
+ val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
698
+ break;
699
+ }
696
700
  }
697
701
  parsed[part] = val;
698
702
  }
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.14
4
+ version: 0.6.15
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-06-04 00:00:00.000000000 Z
12
+ date: 2012-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: 3611102665561405094
115
+ hash: -1080936430256417505
116
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  segments:
123
123
  - 0
124
- hash: 3611102665561405094
124
+ hash: -1080936430256417505
125
125
  requirements: []
126
126
  rubyforge_project:
127
127
  rubygems_version: 1.8.24