import { timeInterval } from "./interval.js";
import { durationMinute, durationWeek } from "./duration.js";
function timeWeekday(v) {
	return timeInterval((e) => {
		e.setDate(e.getDate() - (e.getDay() + 7 - v) % 7), e.setHours(0, 0, 0, 0);
	}, (e, _) => {
		e.setDate(e.getDate() + _ * 7);
	}, (e, v) => (v - e - (v.getTimezoneOffset() - e.getTimezoneOffset()) * durationMinute) / durationWeek);
}
const timeSunday = timeWeekday(0), timeMonday = timeWeekday(1), timeTuesday = timeWeekday(2), timeWednesday = timeWeekday(3), timeThursday = timeWeekday(4), timeFriday = timeWeekday(5), timeSaturday = timeWeekday(6);
timeSunday.range, timeMonday.range, timeTuesday.range, timeWednesday.range, timeThursday.range, timeFriday.range, timeSaturday.range;
function utcWeekday(_) {
	return timeInterval((e) => {
		e.setUTCDate(e.getUTCDate() - (e.getUTCDay() + 7 - _) % 7), e.setUTCHours(0, 0, 0, 0);
	}, (e, _) => {
		e.setUTCDate(e.getUTCDate() + _ * 7);
	}, (e, _) => (_ - e) / durationWeek);
}
const utcSunday = utcWeekday(0), utcMonday = utcWeekday(1), utcTuesday = utcWeekday(2), utcWednesday = utcWeekday(3), utcThursday = utcWeekday(4), utcFriday = utcWeekday(5), utcSaturday = utcWeekday(6);
utcSunday.range, utcMonday.range, utcTuesday.range, utcWednesday.range, utcThursday.range, utcFriday.range, utcSaturday.range;
export { timeFriday, timeMonday, timeSaturday, timeSunday, timeThursday, timeTuesday, timeWednesday, utcFriday, utcMonday, utcSaturday, utcSunday, utcThursday, utcTuesday, utcWednesday };
