UNPKG

@qvant/qui-max

Version:

A Vue 3 Design system for Web.

14 lines (13 loc) 582 B
import toDate from "../../toDate/index.js"; import startOfUTCWeek from "../startOfUTCWeek/index.js"; import startOfUTCWeekYear from "../startOfUTCWeekYear/index.js"; import requiredArgs from "../requiredArgs/index.js"; var MILLISECONDS_IN_WEEK = 6048e5; function getUTCWeek(dirtyDate, options) { requiredArgs(1, arguments); var date = toDate(dirtyDate); var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; } export { getUTCWeek as default }; //# sourceMappingURL=index.js.map