main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { Parser } from "../Parser.mjs";
import { mapValue, parseNDigits } from "../utils.mjs";
export class FractionOfSecondParser extends Parser {
priority = 30;
parse(dateString, token) {
const valueCallback = (value) =>
Math.trunc(value * Math.pow(10, -token.length + 3));
return mapValue(parseNDigits(token.length, dateString), valueCallback);
}
set(date, _flags, value) {
date.setMilliseconds(value);
return date;
}
incompatibleTokens = ["t", "T"];
}