Fix parse date.

This commit is contained in:
邱博亞 2024-09-21 15:43:04 +08:00
parent 5fd1ad909f
commit 4b76561c6f
1 changed files with 1 additions and 1 deletions

View File

@ -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(' ')