active_admin_datetimepicker 0.7.1 → 0.7.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: 5fe148826aac56abdb6868df333355726ead9c3cbf414b289d99316fdb27fbe7
4
- data.tar.gz: bb4aa5c2dfc34d261d6dd4469289da14a251385fdd058801ba7d42a055b0f9fd
3
+ metadata.gz: 37b0c7a60c75a42f97c60f8c49e759948fe12b8ac2690a4c9526ede227e0116c
4
+ data.tar.gz: fa8d55c00d7bcae667b2c93f3dd7c41e3f94c560fc2008a1c2e19bd49467339d
5
5
  SHA512:
6
- metadata.gz: 87cd94c73f8680580ab437f292fcf8b5e6fe97a7c6773fbcc54d40bbf2bd216dad75a44246a4f0db74b244cb8bbc70ff19c67f9ed4c704e5a9b624d6fa26e527
7
- data.tar.gz: 1249f3e2dc2f1cbe5585d22420e220201db943c636420745fae2f8e5d7d0950d3c61ecd3b42adab97ef5e312eb35ee72609a539845bad76f1afa106c0050864d
6
+ metadata.gz: f716b3e7188f53333484d9c7d37dd35a792bd33bf8f978ac188854ac3affce37853069e51cce003f1544fb36b875640c550cb281450ba031ddcb2b4f91dcd675
7
+ data.tar.gz: 45d2d19f6be5feb0c98d42b70db2e4b58faccc9026c96de7e1f305429a2900b4b58ad61af04a453cda3ba525005391023b5f8c045d87122ea9f35b6d55afb203
data/Gemfile CHANGED
@@ -19,4 +19,5 @@ group :test do
19
19
  gem 'capybara'
20
20
  gem 'selenium-webdriver'
21
21
  gem 'chromedriver-helper'
22
+ gem 'byebug'
22
23
  end
@@ -18,7 +18,7 @@ module ActiveAdminDatetimepicker
18
18
  options[:class] = [self.options[:class], html_class].compact.join(' ')
19
19
  options[:data] ||= input_html_data
20
20
  options[:data].merge!(datepicker_options: datetime_picker_options)
21
- options[:value] ||= input_value(input_name)
21
+ options[:value] = input_value(input_name)
22
22
  options[:maxlength] = 19
23
23
  options[:placeholder] = placeholder unless placeholder.nil?
24
24
  end
@@ -26,8 +26,13 @@ module ActiveAdminDatetimepicker
26
26
 
27
27
  def input_value(input_name = nil)
28
28
  val = object.public_send(input_name || method)
29
- return DateTime.new(val.year, val.month, val.day, val.hour, val.min, val.sec).strftime(format) if val.is_a?(Time)
30
- val.to_s
29
+ if val.nil?
30
+ val
31
+ elsif column.type == :date
32
+ val
33
+ else
34
+ DateTime.new(val.year, val.month, val.day, val.hour, val.min, val.sec).strftime(format)
35
+ end
31
36
  end
32
37
 
33
38
  def datetime_picker_options
@@ -11,13 +11,6 @@ module ActiveAdmin
11
11
  end
12
12
  end
13
13
 
14
- def gt_input_name
15
- "#{method}_gteq"
16
- end
17
-
18
- def lt_input_name
19
- "#{method}_lteq"
20
- end
21
14
  end
22
15
  end
23
16
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminDatetimepicker
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_datetimepicker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Fedoronchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-20 00:00:00.000000000 Z
11
+ date: 2019-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails