anjlab-widgets 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/assets/javascripts/anjlab/datepicker.js.coffee +9 -0
- data/lib/anjlab-widgets/version.rb +1 -1
- data/lib/anjlab-widgets.rb +2 -0
- data/spec/dummy/app/models/test_date.rb +12 -0
- data/spec/dummy/app/views/widgets/datepicker.html.erb +3 -1
- data/spec/dummy/app/views/widgets/simple_form.html.erb +2 -3
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 355005b0d7975a1382bd50728ee148a5128c7c33
|
4
|
+
data.tar.gz: 01b84b9b1d72741a3955469b0ce43bce8f94a3c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a73a35f819343d8e5865a9706d4a4a18dffccd74d7d8cb8912e8182a39a223713ce6947f44491311b1ed2d48fad9c5abc4ea367c04d9fb4de99ab6e3204611f2
|
7
|
+
data.tar.gz: 590d24fd3e0e15e69b551eaee6fc5a8240beb8ba9e33e5ea7a1e42f98c9566ec82c22eea469756f6a38fe3ac5d37e16c6bb0b2ce1dc17c771d0eda2f63d00a4b
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Bootstrap date and time pickers for rails (ready for rails 4).
|
|
4
4
|
|
5
5
|
Note: `simple_form` gem is supported.
|
6
6
|
|
7
|
-
Currently `en` and `ru` locales are supported.
|
7
|
+
Currently `en`, `es` and `ru` locales are supported.
|
8
8
|
|
9
9
|
Note: please use it with [bootstrap-rails](https://github.com/anjlab/bootstrap-rails)
|
10
10
|
|
@@ -93,9 +93,9 @@ In your forms:
|
|
93
93
|
|
94
94
|
Converts to native controls if possible (except Chrome - it has ugly native controls).
|
95
95
|
|
96
|
-
|
96
|
+
<img src="https://raw.github.com/anjlab/anjlab-widgets/master/native_date_pic.PNG" width="320" height="568">
|
97
97
|
|
98
|
-
|
98
|
+
<img src="https://raw.github.com/anjlab/anjlab-widgets/master/native_time_pic.PNG" width="320" height="568">
|
99
99
|
|
100
100
|
## Contributing
|
101
101
|
|
@@ -8,6 +8,15 @@ Locales =
|
|
8
8
|
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
|
9
9
|
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
10
10
|
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
11
|
+
es:
|
12
|
+
dates:
|
13
|
+
format: 'dd/mm/yyyy'
|
14
|
+
weekStart: 1
|
15
|
+
days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"]
|
16
|
+
daysShort: ["Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab", "Dom"]
|
17
|
+
daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"]
|
18
|
+
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]
|
19
|
+
monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"]
|
11
20
|
ru:
|
12
21
|
dates:
|
13
22
|
format: 'dd.mm.yyyy'
|
data/lib/anjlab-widgets.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
class TestDate < ActiveRecord::Base
|
2
|
+
# Reference for tableless model: http://codetunes.com/2008/tableless-models-in-rails
|
3
|
+
attr_accessible :now, :today
|
4
|
+
def self.columns() @columns ||= []; end
|
5
|
+
|
6
|
+
def self.column(name, sql_type = nil, default = nil, null = true)
|
7
|
+
columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
|
8
|
+
end
|
9
|
+
|
10
|
+
column :now, :datetime
|
11
|
+
column :today, :date
|
12
|
+
end
|
@@ -4,4 +4,6 @@
|
|
4
4
|
<input data-widget='datepicker' data-date-locale='en'>
|
5
5
|
<input data-widget='datepicker'>
|
6
6
|
<br>
|
7
|
-
<input data-widget='datepicker' data-date-
|
7
|
+
<input data-widget='datepicker' data-date-locale='es'>
|
8
|
+
<input data-widget='datepicker' data-date-allow-blank='false'>
|
9
|
+
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
<%= simple_form_for OpenStruct.new(today: Date.today, now: Time.now), as: 'dates', url: '' do |f| %>
|
1
|
+
<%= simple_form_for TestDate.new(today: Date.today, now: Time.now), url: '/' do |f| %>
|
3
2
|
<%= f.input :today, as: :anjlab_date %>
|
4
3
|
<%= f.input :now, as: :anjlab_time %>
|
5
4
|
<%= f.input :now, as: :anjlab_datetime %>
|
6
|
-
<% end %>
|
5
|
+
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anjlab-widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Korolev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anjlab-bootstrap-rails
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- spec/dummy/app/helpers/application_helper.rb
|
119
119
|
- spec/dummy/app/mailers/.gitkeep
|
120
120
|
- spec/dummy/app/models/.gitkeep
|
121
|
+
- spec/dummy/app/models/test_date.rb
|
121
122
|
- spec/dummy/app/views/layouts/application.html.erb
|
122
123
|
- spec/dummy/app/views/widgets/all.html.erb
|
123
124
|
- spec/dummy/app/views/widgets/datepicker.html.erb
|
@@ -170,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
171
|
version: '0'
|
171
172
|
requirements: []
|
172
173
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.0.
|
174
|
+
rubygems_version: 2.0.3
|
174
175
|
signing_key:
|
175
176
|
specification_version: 4
|
176
177
|
summary: Collection of UI widgets on top of anjlab-bootstrap-rails
|
@@ -184,6 +185,7 @@ test_files:
|
|
184
185
|
- spec/dummy/app/helpers/application_helper.rb
|
185
186
|
- spec/dummy/app/mailers/.gitkeep
|
186
187
|
- spec/dummy/app/models/.gitkeep
|
188
|
+
- spec/dummy/app/models/test_date.rb
|
187
189
|
- spec/dummy/app/views/layouts/application.html.erb
|
188
190
|
- spec/dummy/app/views/widgets/all.html.erb
|
189
191
|
- spec/dummy/app/views/widgets/datepicker.html.erb
|