Fix #25725: add dateAnchor option to typescript-fetch (local default, utc legacy)

IN
21h ago
+1534-0

Fixes #25725

Restores the pre-7.25 UTC anchoring of format: date query parameters behind a new dateAnchor generator option (local by default = current behavior, utc = the legacy toISOString().substring(0, 10) / new Date(value) semantics), as approved in the issue discussion. The option is ignored with a warning for dateLibrary values without date anchoring.

parseDate/serializeDate branch on the option in runtime.mustache; 3 new generator tests plus options coverage; a new date-anchor-utc sample documents the output, and regenerating all 26 typescript-fetch samples with the built CLI proved the default path is byte-identical.


Summary by cubic

Fixes #25725 by adding a dateAnchor option to typescript-fetch so format: date values can keep the pre-7.25 UTC anchoring where the local-calendar behaviour introduced in 7.25.0 shifts the day for non-UTC consumers.

  • dateAnchor=local is the default and produces byte-identical output to the current behaviour.
  • dateAnchor=utc restores the legacy new Date(value) parse and toISOString().substring(0, 10) serialization.
  • The option is ignored with a warning when dateLibrary is string or temporal; invalid values are rejected, and tests plus a date-anchor-utc sample cover both date paths.