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>
23 lines
529 B
Text
23 lines
529 B
Text
import { Parser } from "../Parser.js";
|
|
|
|
import { parseNDigitsSigned } from "../utils.js";
|
|
|
|
export class ExtendedYearParser extends Parser {
|
|
priority = 130;
|
|
|
|
parse(dateString, token) {
|
|
if (token === "u") {
|
|
return parseNDigitsSigned(4, dateString);
|
|
}
|
|
|
|
return parseNDigitsSigned(token.length, dateString);
|
|
}
|
|
|
|
set(date, _flags, value) {
|
|
date.setFullYear(value, 0, 1);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
|
|
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
}
|