From 4b76561c6fa6df7ba0358197ac6055de163af02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 21 Sep 2024 15:43:04 +0800 Subject: [PATCH] Fix parse date. --- lib/tasks/sync_fgu_personal_data_tasks.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/sync_fgu_personal_data_tasks.rake b/lib/tasks/sync_fgu_personal_data_tasks.rake index ffc2268..97ed328 100644 --- a/lib/tasks/sync_fgu_personal_data_tasks.rake +++ b/lib/tasks/sync_fgu_personal_data_tasks.rake @@ -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(' ')