mirror of https://github.com/go-gitea/gitea.git
Have time.js use UTC-related getters/setters when working with `Date`
This commit is contained in:
parent
0f3e717a1a
commit
44ad644df8
|
@ -4,8 +4,8 @@ import {getCurrentLocale} from '../utils.js';
|
||||||
// Returns an array of millisecond-timestamps of start-of-week days (Sundays)
|
// Returns an array of millisecond-timestamps of start-of-week days (Sundays)
|
||||||
export function startDaysBetween(startDate, endDate) {
|
export function startDaysBetween(startDate, endDate) {
|
||||||
// Ensure the start date is a Sunday
|
// Ensure the start date is a Sunday
|
||||||
while (startDate.getDay() !== 0) {
|
while (startDate.getUTCDay() !== 0) {
|
||||||
startDate.setDate(startDate.getDate() + 1);
|
startDate.setUTCDate(startDate.getUTCDate() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const start = dayjs(startDate);
|
const start = dayjs(startDate);
|
||||||
|
|
Loading…
Reference in New Issue