feat: date input - #529
Merged
Merged
feat: date input#529
Conversation
- graph format:date/date-time inputs and policy date properties arrive as dates that keep their original text for output, string() and string functions - d() keeps the instant of offset/Z strings, resolves DST gaps and accepts ISO forms without offset, compact, slash-separated, YYYY-MM and YYYY - dates compare with date strings in ==, !=, <, >, in and contains, and concatenate with strings; deprecated date helpers accept dates - string(date), type() reports date, and date-to-string at string inputs
- parse new date formats by exact shape; keep master formats first and guard DST-gap and extreme-year overflows - text-carrying dates act as strings for object keys, in-object, index, slice, concatenation and bool - deprecated helpers fall back to the date instant; time() accepts dates - schema-less child inputs receive date text; dates satisfy string parameters and slicing in the type checker - convert policy input before validation so dates are parsed once; share rewrite helpers between graph and policy conversion
- every valid date exposes a text form (original or RFC3339), so string functions and slicing on computed dates match the type checker - date and string types merge to string; reference ids typed as dates resolve through their text - input nodes convert declared dates and hand every other converted date back as its original text, following combinators only for structure - date format checks no longer allocate
ivanmiletic
approved these changes
Sep 28, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Inputs declared as dates now arrive as real date values in graphs and policies, instead of plain strings. The caller's original text is kept, so outputs,
string(), templates and string functions behave exactly as before, while date comparisons and methods work withoutd().What changes
Declared dates are dates
{ "type": "string", "format": "date" | "date-time" }(also nullable,anyOf [date, null], with annotation keys liketitle/description/examples) are converted to dates before downstream nodes run.date(entities, relationships, references, globals, arrays) are converted before evaluation.Parsing (
d()and inputs share one parser)Zkeep their real instant (previously the offset was dropped and the wall-clock time was read in the server zone).2023-10-15T14:30[:45[.123]]), compact (20231015,20231015T1430[45]), offset variants (+0200,+02,+02:00), slash dates (2023/10/15[ 14:30[:45]]),2023-10,2023. New forms are matched by exact shape; existing formats are unchanged.d(dateField, 'Zone')re-reads the field's original text in that zone, as before.Dates and strings work together
==,!=,<,<=,>,>=,in,containsbetween a date and a string compare as dates (e.g.birthDate == '1990-05-01', string cells in decision tables).rates[d],d in obj), indexing and slicing, concatenation,bool().date,time,year,dayOfWeek,dateString,startOf, …) accept dates.string(date)works for all dates;type(date)returns'date'.Type checker
date; date/string comparisons, membership and concatenation are allowed; a date is accepted where a string argument or slicing is expected.d(...).Behaviour changes
d('…T10:00:00+05:00').hour()) use the real instant in the server zone.type()of a declared date field is'date'.Testing
core/expression/tests/data/date.csv(formats, offsets, DST gaps, near-misses, date/string comparisons)..tempprobe: expressions, graphs, graph/policy diagnostics and policies identical; one intended analysis change (string vs date comparison).d()parsing at master speed; converting 15k declared dates adds ~0.1 s (graphs) / ~0.08 s (policies).