-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Describe the bug
Day.js is failing to parse a date value generated from a web form, while correctly parsing the same field when generated by our mobile app.
The problem appears to be caused by inconsistent string formats being passed into Day.js. When the event is created by the mobile app, the eventDateTime value is in a format that Day.js parses successfully.
When the event is created using the Add Event web form, a slightly different eventDateTime format is produced. Day.js interprets this value as Invalid Date, which results in our UI showing the field as (none).
Valid date (mobile app)
Day.js correctly parses the date and the Event Detail page renders it.
Invalid date (from form)
Day.js receives a differently formatted date string and fails to parse it, causing the field to display (none).
Expected behavior
Day.js should either:
Correctly parse both formats, or
Provide a consistent parsing result if a format is unsupported, instead of returning (none) in UI where a valid date was submitted.
We expect the Event Detail page to display a valid date regardless of whether the event is created via the mobile app or the web form.
Information
Day.js version: ^1.11.10
UI Library: Antd 5.x
Time zone: GMT-07:00 (Pacific Daylight Time)
Additional Context
It appears the form is generating a date string that does not match Day.js' default supported formats. The mobile app uses a format that is supported.
If Day.js requires explicit formatting during parsing for non-standard formats, clarification in the docs would be helpful, as this inconsistency makes it appear that Day.js is failing only for certain date sources.
