You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JavaScript / Python] Make a pass to implement missing pre-defined Date format #3976
Thanks for filing this! I investigated the current state of standard DateTime format specifiers in both the JavaScript/TypeScript and Python runtime libraries.
Current State
Both dateToStringWithKind (JS: src/fable-library-ts/Date.ts, Python: src/fable-library-py/fable_library/date.py) only handle a handful of single-character format specifiers in their length === 1 switch:
Specifier
Description
JS
Python
d
Short date
✅
✅
D
Long date
✅
✅
T
Long time
✅
✅
t
Short time
✅
✅
O / o
Round-trip (ISO 8601)
✅
✅
R / r
RFC 1123 ("Thu, 01 Jan 2009 00:00:00 GMT")
❌
❌
F
Full date/time (long time)
❌
❌
f
Full date/time (short time)
❌
❌
G
General date/time (long time)
❌
❌
g
General date/time (short time)
❌
❌
M / m
Month/day
❌
❌
s
Sortable (ISO 8601 without timezone)
❌
❌
u
Universal sortable
❌
❌
U
Universal full
❌
❌
Y / y
Year/month
❌
❌
Both targets throw "Unrecognized Date print format" for all unhandled single-character specifiers. The custom-format handler (dateToStringWithCustomFormat) handles multi-character patterns fine.
Implementation Notes
R/r: JS can use date.toUTCString() (already returns RFC 1123 format in modern browsers/Node.js). Python can use date.strftime("%a, %d %b %Y %H:%M:%S GMT") after converting to UTC.
s: ISO 8601 without timezone — JS: date.toISOString().replace('Z', '') (adjusted for local); Python: date.strftime("%Y-%m-%dT%H:%M:%S").
F/f, G/g, M/m, Y/y: These are locale-dependent in .NET. Since Fable doesn't have full locale support, returning the invariant culture equivalent (fixed English format) would be acceptable, similar to how D, d, T, t are implemented.
The fix would be straightforward additions to the switch statement in both src/fable-library-ts/Date.ts and src/fable-library-py/fable_library/date.py, plus dateToStringWithOffset for completeness. Since src/fable-library-py/ is on PyPI, care should be taken not to change existing specifier semantics — only add new cases.
Note
🔒 Integrity filter blocked 103 items
The following items were blocked because they don't meet the GitHub integrity level.
#4488list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#4474list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#4220list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#4166list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#4143list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#4104list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#4044list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#4038list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#3290list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#2279list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
#2154list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
[Feature] Array2D operations #1764list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
Activity
github-actions commentedon Apr 6, 2026
🤖 This is an automated response from Repo Assist.
Thanks for filing this! I investigated the current state of standard DateTime format specifiers in both the JavaScript/TypeScript and Python runtime libraries.
Current State
Both
dateToStringWithKind(JS:src/fable-library-ts/Date.ts, Python:src/fable-library-py/fable_library/date.py) only handle a handful of single-character format specifiers in theirlength === 1switch:dDTtO/oR/rFfGgM/msuUY/yBoth targets throw
"Unrecognized Date print format"for all unhandled single-character specifiers. The custom-format handler (dateToStringWithCustomFormat) handles multi-character patterns fine.Implementation Notes
R/r: JS can usedate.toUTCString()(already returns RFC 1123 format in modern browsers/Node.js). Python can usedate.strftime("%a, %d %b %Y %H:%M:%S GMT")after converting to UTC.s: ISO 8601 without timezone — JS:date.toISOString().replace('Z', '')(adjusted for local); Python:date.strftime("%Y-%m-%dT%H:%M:%S").F/f,G/g,M/m,Y/y: These are locale-dependent in .NET. Since Fable doesn't have full locale support, returning the invariant culture equivalent (fixed English format) would be acceptable, similar to howD,d,T,tare implemented.The fix would be straightforward additions to the
switchstatement in bothsrc/fable-library-ts/Date.tsandsrc/fable-library-py/fable_library/date.py, plusdateToStringWithOffsetfor completeness. Sincesrc/fable-library-py/is on PyPI, care should be taken not to change existing specifier semantics — only add new cases.Note
🔒 Integrity filter blocked 103 items
The following items were blocked because they don't meet the GitHub integrity level.
list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:feat: add missing standard DateTime format specifiers for JS/TS and P…