Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion common/src/util/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
*/
export const getNextQuotaReset = (referenceDate: Date | null): Date => {
const now = new Date()
let nextMonth = new Date(referenceDate ?? now)
if (referenceDate === null) {
const next = new Date(now)
next.setMonth(next.getMonth() + 1)
return next
}
let nextMonth = new Date(referenceDate)
while (nextMonth <= now) {
nextMonth.setMonth(nextMonth.getMonth() + 1)
}
Expand Down
Loading