bootstrap-datepicker-rails 1.1.0.1 → 1.1.1.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: 0707cb1b033e6f2dd26120672932d15b3fb14766
4
- data.tar.gz: 5b7c2e83f55c220e3cd031ae4394e9e790596d7b
3
+ metadata.gz: e01a157d4a970048109c8bb48e603a74b9ade1ef
4
+ data.tar.gz: 5ba977ade0ac771fc26d5b3c302043fa9addbdc5
5
5
  SHA512:
6
- metadata.gz: 7d4a34001568bdc7a377f48f385832330de7c3a74a7aaadc13bc4b0d4f5a891576f8eb38de81445f5e82801f4deb5977c7ebd0ed2e2f44e8be125118f18dbdd9
7
- data.tar.gz: c21f9e0a107770101feebeb8fa5cf92b5bcc52fd959ae37c7298f082543ab90dced005499900de35063a2d6cf126eb2a1edab065975695671436db81c90fca4c
6
+ metadata.gz: 684874023e8fa3cbfe45c84d740d3bd3a93bcd719664172cdb31c86a7a902c01763934d28509695d6cc6c290c27231e5fc73a918802d33970aafb2003149afba
7
+ data.tar.gz: 2d8f616cf4934b1640d881cff70bbe7618dba549ccf48c904abf8d1f159286af9a63fd85fc2bd610abca333313f11464815e7d9dbddc5439e0ee3c4978eca944
data/README.md CHANGED
@@ -52,13 +52,13 @@ Just call datepicker() with any selector.
52
52
  <input type="text" data-behaviour='datepicker' >
53
53
 
54
54
  <script type="text/javascript">
55
- $('[data-behaviour~=datepicker]').datepicker()
55
+ $('[data-behaviour~=datepicker]').datepicker();
56
56
  </script>
57
57
  ```
58
58
 
59
- Here is a live example:
59
+ Examples:
60
60
 
61
- http://jsfiddle.net/2Gg5k/43/
61
+ http://eternicode.github.io/bootstrap-datepicker/
62
62
 
63
63
  There are a lot of options you can pass to datepicker(). They are documented at [https://github.com/eternicode/bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker)
64
64
 
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env rake
2
2
 
3
+ require 'json'
4
+
3
5
  desc "Update assets"
4
6
  task :update do
5
7
  if Dir.exist?('bootstrap-datepicker-src')
@@ -11,6 +13,10 @@ task :update do
11
13
  system("cp bootstrap-datepicker-src/js/bootstrap-datepicker.js vendor/assets/javascripts/bootstrap-datepicker/core.js")
12
14
  system("cp -R bootstrap-datepicker-src/js/locales/ vendor/assets/javascripts/bootstrap-datepicker/locales/")
13
15
  system("git status")
16
+
17
+ puts "\n"
18
+ puts "bootstrap-datepicker version: #{JSON.parse(File.read('./bootstrap-datepicker-src/component.json'))['version']}"
19
+ puts "bootstrap-datepicker-rails version: #{BootstrapDatepickerRails::Rails::VERSION}"
14
20
  end
15
21
 
16
22
  desc "Build"
@@ -17,4 +17,5 @@ Gem::Specification.new do |gem|
17
17
  gem.add_development_dependency "bundler", ">= 1.0"
18
18
  gem.add_development_dependency "rake"
19
19
  gem.add_development_dependency "pry"
20
+ gem.add_development_dependency "json"
20
21
  end
@@ -1,5 +1,5 @@
1
1
  module BootstrapDatepickerRails
2
2
  module Rails
3
- VERSION = "1.1.0.1"
3
+ VERSION = "1.1.1.1"
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@
18
18
  * limitations under the License.
19
19
  * ========================================================= */
20
20
 
21
- !function( $ ) {
21
+ (function( $ ) {
22
22
 
23
23
  function UTCDate(){
24
24
  return new Date(Date.UTC.apply(Date, arguments));
@@ -102,7 +102,7 @@
102
102
  if (!dates[lang]) {
103
103
  lang = lang.split('-')[0];
104
104
  if (!dates[lang])
105
- lang = $.fn.datepicker.defaults.language;
105
+ lang = defaults.language;
106
106
  }
107
107
  o.language = lang;
108
108
 
@@ -247,7 +247,7 @@
247
247
  date: local_date,
248
248
  format: $.proxy(function(altformat){
249
249
  var format = altformat || this.o.format;
250
- return DPGlobal.formatDate(date, format, this.language);
250
+ return DPGlobal.formatDate(date, format, this.o.language);
251
251
  }, this)
252
252
  });
253
253
  },
@@ -633,10 +633,14 @@
633
633
  this._setDate(date, which);
634
634
  break;
635
635
  case 'clear':
636
+ var element;
636
637
  if (this.isInput)
637
- this.element.val("");
638
- else
639
- this.element.find('input').val("");
638
+ element = this.element;
639
+ else if (this.component)
640
+ element = this.element.find('input');
641
+ if (element)
642
+ element.val("").change();
643
+ this._trigger('changeDate');
640
644
  this.update();
641
645
  if (this.o.autoclose)
642
646
  this.hide();
@@ -946,7 +950,7 @@
946
950
  return;
947
951
  }
948
952
  var d = dates[lang];
949
- $.each($.fn.datepicker.locale_opts, function(i,k){
953
+ $.each(locale_opts, function(i,k){
950
954
  if (k in d)
951
955
  out[k] = d[k];
952
956
  });
@@ -966,10 +970,10 @@
966
970
  if (!data) {
967
971
  var elopts = opts_from_el(this, 'date'),
968
972
  // Preliminary otions
969
- xopts = $.extend({}, $.fn.datepicker.defaults, elopts, options),
973
+ xopts = $.extend({}, defaults, elopts, options),
970
974
  locopts = opts_from_locale(xopts.language),
971
975
  // Options priority: js args, data-attrs, locales, defaults
972
- opts = $.extend({}, $.fn.datepicker.defaults, locopts, elopts, options);
976
+ opts = $.extend({}, defaults, locopts, elopts, options);
973
977
  if ($this.is('.input-daterange') || opts.inputs){
974
978
  var ropts = {
975
979
  inputs: opts.inputs || $this.find('input').toArray()
@@ -992,7 +996,7 @@
992
996
  return this;
993
997
  };
994
998
 
995
- $.fn.datepicker.defaults = {
999
+ var defaults = $.fn.datepicker.defaults = {
996
1000
  autoclose: false,
997
1001
  beforeShowDay: $.noop,
998
1002
  calendarWeeks: false,
@@ -1011,7 +1015,7 @@
1011
1015
  todayHighlight: false,
1012
1016
  weekStart: 0
1013
1017
  };
1014
- $.fn.datepicker.locale_opts = [
1018
+ var locale_opts = $.fn.datepicker.locale_opts = [
1015
1019
  'format',
1016
1020
  'rtl',
1017
1021
  'weekStart'
@@ -1101,6 +1105,8 @@
1101
1105
  yyyy: function(d,v){ return d.setUTCFullYear(v); },
1102
1106
  yy: function(d,v){ return d.setUTCFullYear(2000+v); },
1103
1107
  m: function(d,v){
1108
+ if (isNaN(d))
1109
+ return d;
1104
1110
  v -= 1;
1105
1111
  while (v<0) v += 12;
1106
1112
  v %= 12;
@@ -1149,10 +1155,14 @@
1149
1155
  }
1150
1156
  parsed[part] = val;
1151
1157
  }
1152
- for (var i=0, s; i<setters_order.length; i++){
1158
+ for (var i=0, _date, s; i<setters_order.length; i++){
1153
1159
  s = setters_order[i];
1154
- if (s in parsed && !isNaN(parsed[s]))
1155
- setters_map[s](date, parsed[s]);
1160
+ if (s in parsed && !isNaN(parsed[s])){
1161
+ _date = new Date(date);
1162
+ setters_map[s](_date, parsed[s]);
1163
+ if (!isNaN(_date))
1164
+ date = _date;
1165
+ }
1156
1166
  }
1157
1167
  }
1158
1168
  return date;
@@ -1245,4 +1255,4 @@
1245
1255
  $('[data-provide="datepicker-inline"]').datepicker();
1246
1256
  });
1247
1257
 
1248
- }( window.jQuery );
1258
+ }( window.jQuery ));
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Arabic translation for bootstrap-datepicker
3
+ * Mohammed Alshehri <alshehri866@gmail.com>
4
+ */
5
+ ;(function($){
6
+ $.fn.datepicker.dates['ar'] = {
7
+ days: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"],
8
+ daysShort: ["أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت", "أحد"],
9
+ daysMin: ["ح", "ن", "ث", "ع", "خ", "ج", "س", "ح"],
10
+ months: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],
11
+ monthsShort: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],
12
+ today: "هذا اليوم",
13
+ rtl: true
14
+ };
15
+ }(jQuery));
@@ -10,6 +10,7 @@
10
10
  months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
11
11
  monthsShort: ["Jan", "Fev", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Dec"],
12
12
  today: "Aujourd'hui",
13
+ clear: "Effacer",
13
14
  weekStart: 1,
14
15
  format: "dd/mm/yyyy"
15
16
  };
@@ -8,6 +8,8 @@
8
8
  daysShort: ["Mgu", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Mgu"],
9
9
  daysMin: ["Mg", "Sn", "Sl", "Ra", "Ka", "Ju", "Sa", "Mg"],
10
10
  months: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"],
11
- monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"]
11
+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"],
12
+ today: "Hari Ini",
13
+ clear: "Kosongkan"
12
14
  };
13
15
  }(jQuery));
@@ -9,6 +9,7 @@
9
9
  daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
10
10
  months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
11
11
  monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
12
- today: "Hoje"
12
+ today: "Hoje",
13
+ clear: "Limpar"
13
14
  };
14
15
  }(jQuery));
@@ -9,6 +9,8 @@
9
9
  daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],
10
10
  daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
11
11
  months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
12
- monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"]
12
+ monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
13
+ today: "Hoje",
14
+ clear: "Limpar"
13
15
  };
14
16
  }(jQuery));
@@ -3,7 +3,7 @@
3
3
  * Bojan Milosavlević <milboj@gmail.com>
4
4
  */
5
5
  ;(function($){
6
- $.fn.datepicker.dates['rs'] = {
6
+ $.fn.datepicker.dates['rs-latin'] = {
7
7
  days: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"],
8
8
  daysShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"],
9
9
  daysMin: ["N", "Po", "U", "Sr", "Č", "Pe", "Su", "N"],
@@ -9,6 +9,8 @@
9
9
  daysMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö", "Sö"],
10
10
  months: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
11
11
  monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
12
- today: "I Dag"
12
+ today: "I Dag",
13
+ format: "yyyy-mm-dd",
14
+ weekStart: 1
13
15
  };
14
16
  }(jQuery));
@@ -9,7 +9,8 @@
9
9
  daysMin: ["Pz", "Pzt", "Sa", "Çr", "Pr", "Cu", "Ct", "Pz"],
10
10
  months: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"],
11
11
  monthsShort: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"],
12
- today: "Bugün"
12
+ today: "Bugün",
13
+ format: "dd.mm.yyyy"
13
14
  };
14
15
  }(jQuery));
15
16
 
@@ -4,11 +4,13 @@
4
4
  */
5
5
  ;(function($){
6
6
  $.fn.datepicker.dates['zh-CN'] = {
7
- days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
8
- daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
9
- daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
10
- months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
11
- monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
12
- today: "今日"
7
+ days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
8
+ daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
9
+ daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
10
+ months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
11
+ monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
12
+ today: "今日",
13
+ format: "yyyy年mm月dd日",
14
+ weekStart: 1
13
15
  };
14
16
  }(jQuery));
@@ -4,10 +4,13 @@
4
4
  */
5
5
  ;(function($){
6
6
  $.fn.datepicker.dates['zh-TW'] = {
7
- days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
8
- daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
9
- daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
10
- months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
11
- monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
7
+ days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
8
+ daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
9
+ daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
10
+ months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
11
+ monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
12
+ today: "今日",
13
+ format: "yyyy年mm月dd日",
14
+ weekStart: 1
12
15
  };
13
16
  }(jQuery));
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.1.0.1
4
+ version: 1.1.1.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: 2013-06-03 00:00:00.000000000 Z
11
+ date: 2013-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: json
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: A date picker for Twitter Bootstrap
70
84
  email:
71
85
  - siotopo@gmail.com
@@ -140,6 +154,7 @@ files:
140
154
  - testapp/vendor/plugins/.gitkeep
141
155
  - vendor/assets/javascripts/bootstrap-datepicker/core.js
142
156
  - vendor/assets/javascripts/bootstrap-datepicker/index.js
157
+ - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.ar.js
143
158
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.bg.js
144
159
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.br.js
145
160
  - vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.ca.js