-
Notifications
You must be signed in to change notification settings - Fork 809
Open
Description
The DateTimeInput component in both Lit and Angular renderers incorrectly formats the date string for the underlying <input type="date"> element, using 0-indexed months (00-11) instead of the HTML-required 1-indexed format (01-12).
Bug Location
- Lit:
renderers/lit/src/0.8/ui/datetime-input.ts- Line:137 - Angular:
renderers/angular/src/lib/catalog/datetime-input.ts- Line97
Bug Details
When a date is passed to the component (e.g., January 15, 2025):
- The code calls
date.getMonth(), which returns0for January. - It constructs the string:
2025-00-15. - It sets this as the
valueattribute of the input:<input type="date" value="2025-00-15">. - Result: Browsers reject
00as an invalid month and render an empty input.
// Current Code
const month = this.#padNumber(date.getMonth()); // Returns "00" for JanuaryImpact
- Functionality: Users cannot see pre-filled dates in January (and potentially other months depending on browser strictness).
- Cross-Platform: Affects both Lit and Angular implementations equally.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
In Progress