Skip to content

Commit 235b398

Browse files
committed
Update Ration Club event timing to reflect London timezone in ApiController
1 parent d05cede commit 235b398

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

app/controllers/api_controller.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ def events
3636
end
3737
end
3838

39-
# Add weekly Ration Club (Wednesdays, 7–10pm)
40-
now_utc = Time.now.utc
41-
days_until_wed = (3 - now_utc.wday) % 7
42-
ration_start = (now_utc.to_date + days_until_wed).to_time + 19.hours
39+
# Add weekly Ration Club (Wednesdays, 7–10pm London time)
40+
now_london = Time.now.in_time_zone('Europe/London')
41+
days_until_wed = (3 - now_london.wday) % 7
42+
ration_start = (now_london.to_date + days_until_wed).to_time.in_time_zone('Europe/London') + 19.hours
4343
ration_end = ration_start + 3.hours
4444

4545
cal.event do |e|
46-
e.dtstart = Icalendar::Values::DateTime.new(ration_start, tzid: 'UTC')
47-
e.dtend = Icalendar::Values::DateTime.new(ration_end, tzid: 'UTC')
46+
e.dtstart = Icalendar::Values::DateTime.new(ration_start, tzid: 'Europe/London')
47+
e.dtend = Icalendar::Values::DateTime.new(ration_end, tzid: 'Europe/London')
4848
e.summary = 'Ration Club'
4949
e.description = "Register: https://forms.gle/T3rXorsrb4gXKazv9\n\nEach week Newspeak House hosts a community dinner called Ration Club, open to anyone who'd like to find out more about the college and its work."
5050
e.location = 'Newspeak House, 133 Bethnal Green Road, London, E2 7DG, UK'

0 commit comments

Comments
 (0)