Fix bug in time zone.

This commit is contained in:
BoHung Chiu 2021-03-26 11:05:35 +08:00
parent 10f42f67e9
commit 6b82bd0a50
1 changed files with 1 additions and 0 deletions

View File

@ -183,6 +183,7 @@ class AnnouncementsController < ApplicationController
anns = (top_anns + rest_anns).take(widget_data_count) anns = (top_anns + rest_anns).take(widget_data_count)
end end
end end
anns.each{|a| a["postdate"] = a["postdate"].in_time_zone(Time.zone.utc_offset / 3600).strftime('%Y-%m-%d %H:%M') rescue nil }
mp = (anns[0]["img_src"] rescue "") mp = (anns[0]["img_src"] rescue "")
mpd = (anns[0]["img_description"] rescue "") mpd = (anns[0]["img_description"] rescue "")
{ {