From 8ba1baa0457c1d4690deec3bd24f6fe517ac4aaa Mon Sep 17 00:00:00 2001 From: bohung Date: Tue, 23 Aug 2022 20:26:46 +0800 Subject: [PATCH] Fix format bug. --- app/models/writing_conference.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/writing_conference.rb b/app/models/writing_conference.rb index d10e1f3..392626e 100644 --- a/app/models/writing_conference.rb +++ b/app/models/writing_conference.rb @@ -98,7 +98,7 @@ class WritingConference if same_year && same_month date = self.period_start_date.strftime(date_format.sub('%d', "%d-#{self.period_end_date.strftime('%d')}")) elsif same_year - month_date_format = date_format.match(/(%m|%d)[\-\/\.]*(%m|%d)/)[0] rescue '' + month_date_format = date_format.match(/(%b|%m|%d)[\-\/\. ]*(%b|%m|%d)/)[0] rescue '' date = self.period_start_date.strftime(date_format.sub(month_date_format, "#{month_date_format}-#{self.period_end_date.strftime(month_date_format)}")) else date = self.period_start_date.strftime(date_format) + ' ~ ' + self.period_end_date.strftime(date_format)