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.
@@ -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
- # start by the Date.parse method
72
- _value = ::Date.parse(value) rescue nil
71
+ date = ::Date._strptime(value, I18n.t('date.formats.default'))
73
72
 
74
- # try now with the format defined in the current locale
75
- if _value
76
- value = _value
73
+ if date
74
+ value = ::Date.new(date[:year], date[:mon], date[:mday])
77
75
  else
78
- date = ::Date._strptime(value, I18n.t('date.formats.default'))
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
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module CustomFields #:nodoc
3
3
 
4
- VERSION = '2.1.0.rc1'
4
+ VERSION = '2.1.0.rc2'
5
5
 
6
6
  end
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.rc1
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: 2012-12-26 00:00:00.000000000 Z
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: 1276482835020364284
261
+ hash: -956939138895304007
262
262
  version: '0'
263
263
  required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  none: false