Rocky_Mountain_Vending/.pnpm-store/v10/files/2f/8587e39b6c37bc67e0e2ed5c39de9a0b4cbe7e09650225602db917402c34328dad8656803458e05d1349dd348ca5191cfe5bb0bee5574321bdc8a2aac62205
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

62 lines
1.6 KiB
Text

import { setDay } from "../../../setDay.js";
import { Parser } from "../Parser.js";
// Day of week
export class DayParser extends Parser {
priority = 90;
parse(dateString, token, match) {
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return (
match.day(dateString, {
width: "abbreviated",
context: "formatting",
}) ||
match.day(dateString, { width: "short", context: "formatting" }) ||
match.day(dateString, { width: "narrow", context: "formatting" })
);
// T
case "EEEEE":
return match.day(dateString, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return (
match.day(dateString, { width: "short", context: "formatting" }) ||
match.day(dateString, { width: "narrow", context: "formatting" })
);
// Tuesday
case "EEEE":
default:
return (
match.day(dateString, { width: "wide", context: "formatting" }) ||
match.day(dateString, {
width: "abbreviated",
context: "formatting",
}) ||
match.day(dateString, { width: "short", context: "formatting" }) ||
match.day(dateString, { width: "narrow", context: "formatting" })
);
}
}
validate(_date, value) {
return value >= 0 && value <= 6;
}
set(date, _flags, value, options) {
date = setDay(date, value, options);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
}