Update the alert digest wording
This commit is contained in:
@@ -65,6 +65,7 @@ type AlertOverlap struct {
|
||||
Period timeutil.Period `json:"period"`
|
||||
Overlap timeutil.Period `json:"overlap"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Instruction string `json:"instruction,omitempty"`
|
||||
}
|
||||
|
||||
type PrecipTiming struct {
|
||||
@@ -463,6 +464,7 @@ func AlertOverlaps(alertRun *weatherdata.AlertRun, period timeutil.Period) []Ale
|
||||
Period: alert.Period,
|
||||
Overlap: intersect(alert.Period, period),
|
||||
Description: alert.Description,
|
||||
Instruction: alert.Instruction,
|
||||
})
|
||||
}
|
||||
sort.SliceStable(overlaps, func(i int, j int) bool {
|
||||
@@ -476,6 +478,7 @@ type parsedAlert struct {
|
||||
Headline string
|
||||
Severity string
|
||||
Description string
|
||||
Instruction string
|
||||
Period timeutil.Period
|
||||
}
|
||||
|
||||
@@ -488,7 +491,8 @@ func parseAlert(raw json.RawMessage) (parsedAlert, bool) {
|
||||
Event: stringField(fields, "event"),
|
||||
Headline: firstStringField(fields, "headline", "title"),
|
||||
Severity: stringField(fields, "severity"),
|
||||
Description: firstStringField(fields, "description", "instruction"),
|
||||
Description: stringField(fields, "description"),
|
||||
Instruction: stringField(fields, "instruction"),
|
||||
}
|
||||
start, startOK := firstTimeField(fields, "onset", "startsAt", "startTime", "effective", "sent")
|
||||
end, endOK := firstTimeField(fields, "ends", "endsAt", "endTime", "expires")
|
||||
|
||||
Reference in New Issue
Block a user