simple_form-datetimepicker 0.0.1 → 0.0.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c836249996778094e5e811129665b412aa72efd9a4396bf6dec4f39dd8c80809
|
4
|
+
data.tar.gz: 20cad2030e768444281478710559aeeaa3fea14f893e79b312a631edb003f1d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 105021b0ee273079b1cc53925e9aefc14e37494bfe182cb48650f616bdd68eda308c46e7d4a453d833997d1539c69aa84e8a28c0377fd8f5828403f4cba6f138
|
7
|
+
data.tar.gz: d5f0ad650d608f73be8788d8e66b34beda8f284d79e164fd17ae46ff2cbc48c819d11eacbcd8debb19cfbfd5a7139dd8c801ab674a8aa9a4863ff894c86e188d
|
@@ -1,13 +1,17 @@
|
|
1
1
|
class DatePickerInput < SimpleForm::Inputs::StringInput
|
2
2
|
def input_html_options
|
3
|
-
value = object.send(attribute_name)
|
4
3
|
options = {
|
5
|
-
value: value.respond_to?(:to_date) ? I18n.localize(value.to_date, format: :date_picker) : nil,
|
6
4
|
data: {
|
7
5
|
behaviour: 'date_picker',
|
8
6
|
'date-format': I18n.t('date.formats.date_picker_js')
|
9
7
|
}
|
10
8
|
}
|
9
|
+
|
10
|
+
value = if object.respond_to?(attribute_name) && object.send(attribute_name).respond_to?(:to_date)
|
11
|
+
I18n.localize(object.send(attribute_name).to_date, format: :date_picker)
|
12
|
+
end
|
13
|
+
|
14
|
+
options[:value] = value if value.present?
|
11
15
|
options[:data][:'side-by-side'] = @options[:'side_by_side'] || false
|
12
16
|
options[:data][:'icon-provider'] = case @options[:icons]
|
13
17
|
when :font_awesome
|
@@ -1,13 +1,18 @@
|
|
1
1
|
class DateTimePickerInput < SimpleForm::Inputs::StringInput
|
2
2
|
def input_html_options
|
3
|
-
value = object.send(attribute_name)
|
4
3
|
options = {
|
5
|
-
value: value.nil? ? nil : I18n.localize(value, format: :date_picker),
|
6
4
|
data: {
|
7
5
|
behaviour: 'date_picker',
|
8
6
|
'date-format': I18n.t('time.formats.date_picker_js')
|
9
7
|
}
|
10
8
|
}
|
9
|
+
|
10
|
+
value = if object.respond_to?(attribute_name)
|
11
|
+
I18n.localize(object.send(attribute_name), format: :date_picker)
|
12
|
+
end
|
13
|
+
|
14
|
+
options[:value] = value if value.present?
|
15
|
+
|
11
16
|
options[:data][:'side-by-side'] = @options[:'side_by_side'] || false
|
12
17
|
options[:data][:'icon-provider'] = case @options[:icons]
|
13
18
|
when :font_awesome
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form-datetimepicker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|