Rocky_Mountain_Vending/.pnpm-store/v10/files/82/79bb74bd55851c676734dfa7a7b31de977eba743d0c37cca3180fc7440ca866f0bc66d0fdc269c8b773bcc7430d93e43e2734d27ad08e49c6f4e0711e011d2
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

43 lines
1 KiB
Text

"use strict";
exports.Hour1to12Parser = void 0;
var _constants = require("../constants.cjs");
var _Parser = require("../Parser.cjs");
var _utils = require("../utils.cjs");
class Hour1to12Parser extends _Parser.Parser {
priority = 70;
parse(dateString, token, match) {
switch (token) {
case "h":
return (0, _utils.parseNumericPattern)(
_constants.numericPatterns.hour12h,
dateString,
);
case "ho":
return match.ordinalNumber(dateString, { unit: "hour" });
default:
return (0, _utils.parseNDigits)(token.length, dateString);
}
}
validate(_date, value) {
return value >= 1 && value <= 12;
}
set(date, _flags, value) {
const isPM = date.getHours() >= 12;
if (isPM && value < 12) {
date.setHours(value + 12, 0, 0, 0);
} else if (!isPM && value === 12) {
date.setHours(0, 0, 0, 0);
} else {
date.setHours(value, 0, 0, 0);
}
return date;
}
incompatibleTokens = ["H", "K", "k", "t", "T"];
}
exports.Hour1to12Parser = Hour1to12Parser;