DATETIME_PACKAGE
const DATETIME_PACKAGE: IEnginePackage;Defined in: packages/engine/src/packages/datetime/DatetimePackage.ts:98
Date/time keywords: now, today, tomorrow, yesterday,
next <Weekday>/last <Weekday>, <unit> until <Datetime>/<unit> since <Datetime>.
Uses the datetime arithmetic opcodes (DATE_ADD/DATE_SUB/DATE_NEXT_WEEKDAY/DATE_LAST_WEEKDAY)
plus the shared UoM conversion opcode (UOM_CONVERT_IN) for until/since.
Also: workdays/weekdays and timestamps/ISO8601
workdays in <duration>. SeeWorkdaysInParselet.ts.<date> + N workdays/<date> - N workdays, plain ”+”/”-” arithmetic, special-cased invm/VM.ts’s ADD/SUB dispatch for theworkday/workdaysUNIT (seelexer/units.ts) since business-day math needs actual weekend-skipping, not a linear ms conversion.<amount>/workday x <duration>, a Rate, exactly like$99/weekalready works, usinguom/UomConverter.ts’s workday<->day shim sogetMeasure()/convertUnit()treat “workday” as a Time-measure unit (5 workdays == 7 calendar days). See that file’s doc comment. The bare-denominator syntax$500/workday(no explicit “1”) additionally needsworkdayRateDenominatorNormalizerRule. See its doc comment.day of the week on <date>/weekday on <date>, and the natural-question forms over the same three date fieldswhat day is it,what day is it on <date>,what day is it in <duration>, and themonth/weekequivalents. All one parselet, seeDateFieldQueryParselet.ts. The same fields are also available composably as<date> as weekday/as month/as weekviaasConvertersbelow.<unit> between <date> and <date>, the two-explicit-endpoints sibling ofuntil/since, seeDurationBetweenParselet.ts. A leadinghow manyis accepted for it and foruntil/since, seeBetweenUnitNormalizerRule.ts.<date> is a weekend/is a workday, postfix predicates, seeDayTypePredicateParselet.ts. Mon-Fri only, matching the workday scope decision below.current timestamp/<date/time> to timestamp/<ISO8601 string or unix timestamp> to date. SeeCurrentTimestampParselet.ts/ToTimestampParselet.ts/ToDateParselet.tsandDatetimeTimestampPluginFunctions.ts.- Bare numeric date literals,
25/12/2023(European DD/MM/YYYY)12-25-2023(US MM-DD-YYYY),2023-12-25(ISO YYYY-MM-DD), and25.12.2023(dot-separated DD.MM.YYYY), fused into a singleDATETIME_LITERALtoken bydateLiteralNormalizerRule()and pushed byDateLiteralParselet. Ported from the siblingfeat/safety-limits-datetime-literalsbranch referenced inIso8601.ts’s and the Stocks package’sDatePhrase.ts’s doc comments. This is that work, now merged. <date/time> as iso8601, registered below viaasConverters(theConverterspackage’s<expr> as <type>extension point, seeapi/PackageRegistry.ts’s doc comment) rather than a new opcode or aConverters-package-owned built-in name:asConvertersalready exists precisely for a third-party/domain package to contribute a newas <name>target without touchingAsConverterParselet.tsorOpCode.tsat all, and “iso8601” is inherently a datetime-package concept (needsIso8601.ts’s formatting, which already lives here) simpler to keep it self-contained in this package than to split the feature across two packages for a marginal “which package owns the converter-name list” tidiness gain.
SCOPE DECISION (workdays, both the count and the date-arithmetic forms):
plain Mon-Fri business-day math, with NO public-holiday exclusion.
SoulverCore’s own workday calculations auto-exclude public holidays via
a live-updating, region-configurable holiday database, picking which
holidays/region and keeping such a database current is real, separate
scope this pass deliberately does not take on (see vm/VM.ts’s
addBusinessDays() doc comment for the fuller version of this note,
matching this session’s established pattern of documenting a scoped-down
simplification rather than silently pretending to support something it
doesn’t, e.g. Finance’s “no hardcoded tax rate” decision).