Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 9c38b6f

Browse files
authored
Merge pull request #101 from grafana/alexweav/mute-timing-serialization
Alerting: Fix timestamp serialization in mute timings
2 parents 4b8162b + 99676fa commit 9c38b6f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

alerting_mute_timing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ type TimeInterval struct {
2424

2525
// TimeRange represents a range of minutes within a 1440 minute day, exclusive of the End minute.
2626
type TimeRange struct {
27-
StartMinute int
28-
EndMinute int
27+
StartMinute string `json:"start_time"`
28+
EndMinute string `json:"end_time"`
2929
}
3030

3131
// A WeekdayRange is an inclusive range of weekdays, e.g. "monday" or "tuesday:thursday".

alerting_mute_timing_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ func createMuteTiming() MuteTiming {
9797
Name: "timing two",
9898
TimeIntervals: []TimeInterval{
9999
{
100+
Times: []TimeRange{
101+
{
102+
StartMinute: "13:13",
103+
EndMinute: "15:15",
104+
},
105+
},
100106
Weekdays: []WeekdayRange{"monday", "wednesday"},
101107
Months: []MonthRange{"1:3", "4"},
102108
Years: []YearRange{"2022", "2023"},

0 commit comments

Comments
 (0)