Rocky_Mountain_Vending/.pnpm-store/v10/files/1d/8a67fc736f1a04bfe34f9ad32ad518f5c25f24c496e20e19310f4229964ac9aad59e3d0270f01dd16f6a677b6eee09ee74e73be49f52e18a7aa4ca0cc7f392
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

35 lines
872 B
Text

import { numericPatterns } from "../constants.js";
import { Parser } from "../Parser.js";
import { parseNDigits, parseNumericPattern } from "../utils.js";
export class Hour0To11Parser extends Parser {
priority = 70;
parse(dateString, token, match) {
switch (token) {
case "K":
return parseNumericPattern(numericPatterns.hour11h, dateString);
case "Ko":
return match.ordinalNumber(dateString, { unit: "hour" });
default:
return parseNDigits(token.length, dateString);
}
}
validate(_date, value) {
return value >= 0 && value <= 11;
}
set(date, _flags, value) {
const isPM = date.getHours() >= 12;
if (isPM && value < 12) {
date.setHours(value + 12, 0, 0, 0);
} else {
date.setHours(value, 0, 0, 0);
}
return date;
}
incompatibleTokens = ["h", "H", "k", "t", "T"];
}