anjlab-widgets 1.0.3 → 1.0.4

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: c90906072e488491995605f9f985a2123d2e02d1
4
- data.tar.gz: 86661e1be6f1eef10ffe03d6e8ce673936d4ad7b
3
+ metadata.gz: 355005b0d7975a1382bd50728ee148a5128c7c33
4
+ data.tar.gz: 01b84b9b1d72741a3955469b0ce43bce8f94a3c0
5
5
  SHA512:
6
- metadata.gz: b90011e63c5d14428eb1e090c11042391c82bad60053282250ffd8fa14f7da48b5a089d7f2d0c49c17798ceeccaebb4d3ccd1842a931fdb2d5007688d774fc3a
7
- data.tar.gz: cc9503205f2ed42de42e341f57b02cc8d0e53751392d146ae3d5e5048a012ded42d366aac31e65d860477c8e20da766c593b8233070e036a66b2960778d810b3
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
- ![native date picker](https://raw.github.com/anjlab/anjlab-widgets/master/native_date_pic.PNG)
96
+ <img src="https://raw.github.com/anjlab/anjlab-widgets/master/native_date_pic.PNG" width="320" height="568">
97
97
 
98
- ![native time picker](https://raw.github.com/anjlab/anjlab-widgets/master/native_time_pic.PNG)
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'
@@ -1,5 +1,5 @@
1
1
  module Anjlab
2
2
  module Widgets
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
@@ -9,6 +9,8 @@ module Anjlab
9
9
  "%d.%m.%Y"
10
10
  when :en
11
11
  "%m/%d/%Y"
12
+ when :es
13
+ "%d/%m/%Y"
12
14
  else
13
15
  "%Y-%m-%d"
14
16
  end
@@ -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-allow-blank='false'>
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.3
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-03-15 00:00:00.000000000 Z
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.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