Rocky_Mountain_Vending/.pnpm-store/v10/files/b5/00cdd15d24f1656b6767dd1acb3d233b28a05de21ae796b479c05a952133a9cc412888742a2e88a9f0b3a8a6c7faac5246f3f1105a9091478ef91047e95b57
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

42 lines
1.2 KiB
Text

"use strict";
exports.getISOWeek = getISOWeek;
var _index = require("./constants.cjs");
var _index2 = require("./startOfISOWeek.cjs");
var _index3 = require("./startOfISOWeekYear.cjs");
var _index4 = require("./toDate.cjs");
/**
* The {@link getISOWeek} function options.
*/
/**
* @name getISOWeek
* @category ISO Week Helpers
* @summary Get the ISO week of the given date.
*
* @description
* Get the ISO week of the given date.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param date - The given date
* @param options - The options
*
* @returns The ISO week
*
* @example
* // Which week of the ISO-week numbering year is 2 January 2005?
* const result = getISOWeek(new Date(2005, 0, 2))
* //=> 53
*/
function getISOWeek(date, options) {
const _date = (0, _index4.toDate)(date, options?.in);
const diff =
+(0, _index2.startOfISOWeek)(_date) -
+(0, _index3.startOfISOWeekYear)(_date);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / _index.millisecondsInWeek) + 1;
}