bootstrap-datepicker-rails 0.6.13 → 0.6.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rvmrc +4 -4
- data/README.md +25 -5
- data/lib/bootstrap-datepicker-rails/version.rb +1 -1
- data/vendor/assets/javascripts/bootstrap-datepicker/core.js +18 -3
- data/vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.cs.js +13 -0
- data/vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.ms.js +13 -0
- metadata +7 -5
data/.rvmrc
CHANGED
@@ -6,10 +6,10 @@
|
|
6
6
|
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
7
|
# Only full ruby name is supported here, for short names use:
|
8
8
|
# echo "rvm use 1.9.3" > .rvmrc
|
9
|
-
environment_id="ruby-1.9.3-
|
9
|
+
environment_id="ruby-1.9.3-p194@bootstrap-datepicker-rails"
|
10
10
|
|
11
11
|
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
-
# rvmrc_rvm_version="1.
|
12
|
+
# rvmrc_rvm_version="1.13.5 (master)" # 1.10.1 seams as a safe start
|
13
13
|
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
14
|
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
15
|
# return 1
|
@@ -36,7 +36,7 @@ fi
|
|
36
36
|
# If you use bundler, this might be useful to you:
|
37
37
|
# if [[ -s Gemfile ]] && {
|
38
38
|
# ! builtin command -v bundle >/dev/null ||
|
39
|
-
# builtin command -v bundle | grep $rvm_path/bin/bundle >/dev/null
|
39
|
+
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
40
40
|
# }
|
41
41
|
# then
|
42
42
|
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
@@ -44,5 +44,5 @@ fi
|
|
44
44
|
# fi
|
45
45
|
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
46
46
|
# then
|
47
|
-
# bundle install | grep -vE '^Using|Your bundle is complete'
|
47
|
+
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
48
48
|
# fi
|
data/README.md
CHANGED
@@ -32,22 +32,28 @@ gem 'bootstrap-datepicker-rails', :require => 'bootstrap-datepicker-rails',
|
|
32
32
|
|
33
33
|
and run bundle install.
|
34
34
|
|
35
|
-
##
|
35
|
+
## Configuration
|
36
36
|
|
37
|
-
Add
|
37
|
+
Add this line to app/assets/stylesheets/application.css
|
38
38
|
|
39
39
|
``` css
|
40
40
|
*= require bootstrap-datepicker
|
41
41
|
```
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
Add necessary javascript(s) files to app/assets/javascripts/application.js
|
43
|
+
Add this line to app/assets/javascripts/application.js
|
46
44
|
|
47
45
|
``` javascript
|
48
46
|
//= require bootstrap-datepicker
|
49
47
|
```
|
50
48
|
|
49
|
+
You can fine tune the included files to suit your needs.
|
50
|
+
|
51
|
+
```javascript
|
52
|
+
//= require bootstrap-datepicker/core
|
53
|
+
//= require bootstrap-datepicker/locales/bootstrap-datepicker.es
|
54
|
+
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr
|
55
|
+
```
|
56
|
+
|
51
57
|
## Using bootstrap-datepicker-rails
|
52
58
|
|
53
59
|
Just call datepicker() with any selector.
|
@@ -56,8 +62,22 @@ Just call datepicker() with any selector.
|
|
56
62
|
$('.datepicker').datepicker()
|
57
63
|
```
|
58
64
|
|
65
|
+
You can also use unobtrusive javascript like this:
|
66
|
+
|
67
|
+
```javascript
|
68
|
+
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
69
|
+
$(this).datepicker({"format": "yyyy-mm-dd", "weekStart": 1, "autoclose": true});
|
70
|
+
});
|
71
|
+
|
72
|
+
<input type="text" data-behaviour='datepicker' >
|
73
|
+
|
74
|
+
```
|
75
|
+
|
59
76
|
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)
|
60
77
|
|
78
|
+
## Questions? Bugs?
|
79
|
+
|
80
|
+
Use Github Issues.
|
61
81
|
|
62
82
|
## License
|
63
83
|
Copyright (c) 2011 Gonzalo Rodríguez-Baltanás Díaz
|
@@ -47,6 +47,14 @@
|
|
47
47
|
});
|
48
48
|
} else {
|
49
49
|
if (this.component){
|
50
|
+
// For components that are not readonly, allow keyboard nav
|
51
|
+
this.element.find('input').on({
|
52
|
+
focus: $.proxy(this.show, this),
|
53
|
+
blur: $.proxy(this._hide, this),
|
54
|
+
keyup: $.proxy(this.update, this),
|
55
|
+
keydown: $.proxy(this.keydown, this)
|
56
|
+
});
|
57
|
+
|
50
58
|
this.component.on('click', $.proxy(this.show, this));
|
51
59
|
var element = this.element.find('input');
|
52
60
|
element.on({
|
@@ -194,7 +202,7 @@
|
|
194
202
|
|
195
203
|
update: function(){
|
196
204
|
this.date = DPGlobal.parseDate(
|
197
|
-
this.isInput ? this.element.prop('value') : this.element.data('date'),
|
205
|
+
this.isInput ? this.element.prop('value') : this.element.data('date') || this.element.find('input').prop('value'),
|
198
206
|
this.format, this.language
|
199
207
|
);
|
200
208
|
if (this.date < this.startDate) {
|
@@ -368,6 +376,7 @@
|
|
368
376
|
break;
|
369
377
|
case 'span':
|
370
378
|
if (!target.is('.disabled')) {
|
379
|
+
this.viewDate.setDate(1);
|
371
380
|
if (target.is('.month')) {
|
372
381
|
var month = target.parent().find('span').index(target);
|
373
382
|
this.viewDate.setMonth(month);
|
@@ -650,8 +659,14 @@
|
|
650
659
|
setters_map = {
|
651
660
|
yyyy: function(d,v){ return d.setFullYear(v); },
|
652
661
|
yy: function(d,v){ return d.setFullYear(2000+v); },
|
653
|
-
m: function(d,v){
|
654
|
-
|
662
|
+
m: function(d,v){
|
663
|
+
v -= 1;
|
664
|
+
d.setMonth(v);
|
665
|
+
while (d.getMonth() != v)
|
666
|
+
d.setDate(d.getDate()-1);
|
667
|
+
return d;
|
668
|
+
},
|
669
|
+
d: function(d,v){ return d.setDate(v); }
|
655
670
|
},
|
656
671
|
val, filtered, part;
|
657
672
|
setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Czech translation for bootstrap-datepicker
|
3
|
+
* Matěj Koubík <matej@koubik.name>
|
4
|
+
*/
|
5
|
+
;(function($){
|
6
|
+
$.fn.datepicker.dates['cs'] = {
|
7
|
+
days: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota", "Neděle"],
|
8
|
+
daysShort: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So", "Ne"],
|
9
|
+
daysMin: ["N", "P", "Ú", "St", "Č", "P", "So", "N"],
|
10
|
+
months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
|
11
|
+
monthsShort: ["Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čnc", "Srp", "Zář", "Říj", "Lis", "Pro"]
|
12
|
+
};
|
13
|
+
}(jQuery));
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Malay translation for bootstrap-datepicker
|
3
|
+
* Ateman Faiz <noorulfaiz@gmail.com>
|
4
|
+
*/
|
5
|
+
;(function($){
|
6
|
+
$.fn.datepicker.dates['de'] = {
|
7
|
+
days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"],
|
8
|
+
daysShort: ["Aha", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab", "Aha"],
|
9
|
+
daysMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa", "Ah"],
|
10
|
+
months: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"],
|
11
|
+
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"]
|
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.
|
4
|
+
version: 0.6.14
|
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-
|
12
|
+
date: 2012-06-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- vendor/assets/javascripts/bootstrap-datepicker/core.js
|
80
80
|
- vendor/assets/javascripts/bootstrap-datepicker/index.js
|
81
81
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.br.js
|
82
|
+
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.cs.js
|
82
83
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.da.js
|
83
84
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.de.js
|
84
85
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.es.js
|
@@ -87,6 +88,7 @@ files:
|
|
87
88
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.is.js
|
88
89
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.it.js
|
89
90
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.lv.js
|
91
|
+
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.ms.js
|
90
92
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.nb.js
|
91
93
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.nl.js
|
92
94
|
- vendor/assets/javascripts/bootstrap-datepicker/locales/bootstrap-datepicker.pl.js
|
@@ -110,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
112
|
version: '0'
|
111
113
|
segments:
|
112
114
|
- 0
|
113
|
-
hash:
|
115
|
+
hash: 3611102665561405094
|
114
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
117
|
none: false
|
116
118
|
requirements:
|
@@ -119,10 +121,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
121
|
version: '0'
|
120
122
|
segments:
|
121
123
|
- 0
|
122
|
-
hash:
|
124
|
+
hash: 3611102665561405094
|
123
125
|
requirements: []
|
124
126
|
rubyforge_project:
|
125
|
-
rubygems_version: 1.8.
|
127
|
+
rubygems_version: 1.8.24
|
126
128
|
signing_key:
|
127
129
|
specification_version: 3
|
128
130
|
summary: A date picker for Twitter Bootstrap
|