Simplify and rationalize the hourly report template
This commit is contained in:
@@ -60,7 +60,7 @@ func BuildHourlyRenderContext(metadata briefing.Metadata, snapshot module.Snapsh
|
||||
Title: "Hourly Report",
|
||||
LocationName: locationName(metadata),
|
||||
GeneratedAt: metadata.GeneratedAt,
|
||||
GeneratedAtLabel: timeLabel(metadata.GeneratedAt, location),
|
||||
GeneratedAtLabel: generatedAtLabel(metadata.GeneratedAt, location),
|
||||
ValidPeriod: metadata.ValidPeriod,
|
||||
ValidPeriodLabel: periodLabel(metadata.ValidPeriod, location),
|
||||
Timezone: metadata.Timezone,
|
||||
@@ -159,3 +159,7 @@ func periodLabel(period timeutil.Period, location *time.Location) string {
|
||||
func timeLabel(value time.Time, location *time.Location) string {
|
||||
return value.In(location).Format("2006-01-02 at 3:04 PM")
|
||||
}
|
||||
|
||||
func generatedAtLabel(value time.Time, location *time.Location) string {
|
||||
return value.In(location).Format("Monday, January 2, 2006 at 3:04 PM")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user