Rocky_Mountain_Vending/.pnpm-store/v10/files/f2/05616107b30aac276e8e36cba8782f028d3101d1a5343579f7301b372e0b2935f7425f31f3833bfefdc53f24b17b5800dcdfb3ab1e19b6a6afe09ae596da67
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

68 lines
1.6 KiB
Text

"use strict";
exports.DateParser = void 0;
var _constants = require("../constants.cjs");
var _Parser = require("../Parser.cjs");
var _utils = require("../utils.cjs");
var _index = require("../../../_core/getMonth.cjs");
var _index2 = require("../../../_core/setDate.cjs");
var _index3 = require("../../../_core/getFullYear.cjs");
const DAYS_IN_MONTH = [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29];
const DAYS_IN_MONTH_LEAP_YEAR = [
31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30,
];
// Day of the month
class DateParser extends _Parser.Parser {
priority = 90;
subPriority = 1;
parse(dateString, token, match) {
switch (token) {
case "d":
return (0, _utils.parseNumericPattern)(
_constants.numericPatterns.date,
dateString,
);
case "do":
return match.ordinalNumber(dateString, { unit: "date" });
default:
return (0, _utils.parseNDigits)(token.length, dateString);
}
}
validate(date, value) {
const year = (0, _index3.getFullYear)(date);
const isLeapYear = (0, _utils.isLeapYearIndex)(year);
const month = (0, _index.getMonth)(date);
if (isLeapYear) {
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
} else {
return value >= 1 && value <= DAYS_IN_MONTH[month];
}
}
set(date, _flags, value) {
(0, _index2.setDate)(date, value);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = [
"Y",
"R",
"q",
"Q",
"w",
"I",
"D",
"i",
"e",
"c",
"t",
"T",
];
}
exports.DateParser = DateParser;