import { timeInterval } from "./interval.js";
const timeYear = timeInterval((e) => {
	e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
}, (e, t) => {
	e.setFullYear(e.getFullYear() + t);
}, (e, t) => t.getFullYear() - e.getFullYear(), (e) => e.getFullYear());
timeYear.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : timeInterval((e) => {
	e.setFullYear(Math.floor(e.getFullYear() / t) * t), e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
}, (e, n) => {
	e.setFullYear(e.getFullYear() + n * t);
}), timeYear.range;
const utcYear = timeInterval((e) => {
	e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
}, (e, t) => {
	e.setUTCFullYear(e.getUTCFullYear() + t);
}, (e, t) => t.getUTCFullYear() - e.getUTCFullYear(), (e) => e.getUTCFullYear());
utcYear.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : timeInterval((e) => {
	e.setUTCFullYear(Math.floor(e.getUTCFullYear() / t) * t), e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
}, (e, n) => {
	e.setUTCFullYear(e.getUTCFullYear() + n * t);
}), utcYear.range;
export { timeYear, utcYear };
