Skip to content

Commit 336e663

Browse files
authored
fix: parse insights start and end time (#8826)
1 parent a96c4a3 commit 336e663

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coderd/insights_internal_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ func Test_parseInsightsStartAndEndTime(t *testing.T) {
5050
startTime: today.Format(layout),
5151
endTime: thisHour.Format(layout),
5252
},
53-
wantStartTime: time.Date(2023, 7, today.Day(), 0, 0, 0, 0, time.UTC),
54-
wantEndTime: time.Date(2023, 7, today.Day(), thisHour.Hour(), 0, 0, 0, time.UTC),
53+
wantStartTime: time.Date(today.Year(), today.Month(), today.Day(), 0, 0, 0, 0, time.UTC),
54+
wantEndTime: time.Date(today.Year(), today.Month(), today.Day(), thisHour.Hour(), 0, 0, 0, time.UTC),
5555
wantOk: true,
5656
},
5757
{
@@ -68,8 +68,8 @@ func Test_parseInsightsStartAndEndTime(t *testing.T) {
6868
startTime: today.Format(layout),
6969
endTime: thisHourRoundUp.Format(layout),
7070
},
71-
wantStartTime: time.Date(2023, 7, today.Day(), 0, 0, 0, 0, time.UTC),
72-
wantEndTime: time.Date(2023, 7, thisHourRoundUp.Day(), thisHourRoundUp.Hour(), 0, 0, 0, time.UTC),
71+
wantStartTime: time.Date(today.Year(), today.Month(), today.Day(), 0, 0, 0, 0, time.UTC),
72+
wantEndTime: time.Date(today.Year(), today.Month(), thisHourRoundUp.Day(), thisHourRoundUp.Hour(), 0, 0, 0, time.UTC),
7373
wantOk: true,
7474
},
7575
{

0 commit comments

Comments
 (0)