custom_fields 2.1.0.rc1 → 2.1.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/custom_fields/types/date.rb +4 -7
- data/lib/custom_fields/version.rb +1 -1
- metadata +3 -3
@@ -68,15 +68,12 @@ module CustomFields
|
|
68
68
|
|
69
69
|
def _set_formatted_date(name, value)
|
70
70
|
if value.is_a?(::String) && !value.blank?
|
71
|
-
|
72
|
-
_value = ::Date.parse(value) rescue nil
|
71
|
+
date = ::Date._strptime(value, I18n.t('date.formats.default'))
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
value = _value
|
73
|
+
if date
|
74
|
+
value = ::Date.new(date[:year], date[:mon], date[:mday])
|
77
75
|
else
|
78
|
-
|
79
|
-
value = date ? ::Date.new(date[:year], date[:mon], date[:mday]) : nil
|
76
|
+
value = ::Date.parse(value) rescue nil
|
80
77
|
end
|
81
78
|
end
|
82
79
|
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: custom_fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 2.1.0.
|
5
|
+
version: 2.1.0.rc2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Didier Lafforgue
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
type: :runtime
|
@@ -258,7 +258,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
258
258
|
- !ruby/object:Gem::Version
|
259
259
|
segments:
|
260
260
|
- 0
|
261
|
-
hash:
|
261
|
+
hash: -956939138895304007
|
262
262
|
version: '0'
|
263
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
264
|
none: false
|