Fix parse date.
This commit is contained in:
parent
5fd1ad909f
commit
4b76561c6f
|
@ -17,7 +17,7 @@ module FguSyncPlugin
|
|||
["zh_tw", "en"].map{|l| [l, d]}.to_h
|
||||
end
|
||||
def self.parse_date(d)
|
||||
(d.present? ? (Date.parse(d) rescue nil) : nil)
|
||||
(d.present? ? (d.class == String ? (Date.parse(d) rescue nil) : d) : nil)
|
||||
end
|
||||
def self.camelize(str)
|
||||
str.split('_').map{|v| v.capitalize}.join(' ')
|
||||
|
|
Loading…
Reference in New Issue