Skip to content

Commit

Permalink
Allow override of timeZoneInfo
Browse files Browse the repository at this point in the history
avoids the need to parse the last agenda
  • Loading branch information
sebbASF committed Dec 31, 2023
1 parent 567d872 commit fe42123
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions www/board/agenda/views/actions/reminder-text.json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
# read template for the reminders
template = File.read(File.join(FOUNDATION_BOARD, 'templates', "#{@reminder}.mustache"))

# find the latest agenda
agenda = Dir[File.join(FOUNDATION_BOARD, 'board_agenda_*.txt')].max
# Allow override of timeZoneInfo (avoids the need to parse the last agenda)
timeZoneInfo = @tzlink
unless timeZoneInfo
# find the latest agenda
agenda = Dir[File.join(FOUNDATION_BOARD, 'board_agenda_*.txt')].max
timeZoneInfo = File.read(agenda)[/Other Time Zones: (.*)/, 1]
end

# determine meeting time
meeting = ASF::Board.nextMeeting
Expand All @@ -21,7 +26,7 @@
meetingDate: meeting.strftime("%a, %d %b %Y at %H:%M %Z"),
month: meeting.strftime("%B"),
year: meeting.year.to_s,
timeZoneInfo: File.read(agenda)[/Other Time Zones: (.*)/, 1],
timeZoneInfo: timeZoneInfo,
dueDate: dueDate.strftime("%a %b #{dueDate.day.ordinalize}"),
agenda: meeting.strftime("https://whimsy.apache.org/board/agenda/%Y-%m-%d/")
}
Expand Down

0 comments on commit fe42123

Please sign in to comment.