Openstatus www.openstatus.dev

fck: daylight savings (#425)

authored by

Maximilian Kaske and committed by
GitHub
2916c5a0 96ba552c

+6 -2
+6 -2
apps/web/src/lib/tracker.ts
··· 104 104 } 105 105 106 106 const startDate = new Date(data[0].cronTimestamp); 107 - const endDate = new Date(data[data.length - 1].cronTimestamp); 107 + const endDate = new Date( 108 + new Date(data[data.length - 1].cronTimestamp).setHours(23, 59, 59, 999), 109 + ); 110 + 108 111 // The reason why we cannot use `date-fns` is because it isn't supported on the edge 109 112 // const dateSequence = eachDayOfInterval({start:startDate, end:endDate}) 110 113 const dateSequence = generateDateSequence(startDate, endDate); ··· 116 119 const currentTimestamp = currentDate.getTime(); 117 120 if ( 118 121 dataIndex < data.length && 119 - data[dataIndex].cronTimestamp === currentTimestamp 122 + (data[dataIndex].cronTimestamp === currentTimestamp || 123 + data[dataIndex].cronTimestamp + 60 * 60 * 1000 === currentTimestamp) 120 124 ) { 121 125 filledData.push(data[dataIndex]); 122 126 dataIndex++;