react-uswds icon indicating copy to clipboard operation
react-uswds copied to clipboard

[feat] Modifiable external_date_format

Open tylerbarna opened this issue 1 year ago • 3 comments

Does your feature request relate to a specific USWDS component?

DatePicker and, by extension, DateRangePicker

What USWDS Version is this feature present in?

2.8.0 via #803

Is your feature request related to a problem? Please describe.

The date range picker doesn't seem to have a way to modify the external date format from MM/DD/YYYY to other common formats, though YYYY-MM-DD is used in the backend

Describe the solution you'd like

Provide a property to a call to DateRangePicker or DatePicker to specify the external date format. In my case, having an option to use the YYYY-MM-DD format in both the backend and frontend

Describe alternatives you've considered

Attempted to work around this by converting from MM/DD/YYYY to YYYY-MM-DD after setting a URL parameter, but this is not reflected in the URL parameter itself and also results in the date picker element being blank

Additional context

I'm attempting to implement a date range filter for the NASA GCN Project (in-progress PR for backend here) with a consistent ISO format for both front and backend, as astronomers are more inclined to use YYYY-MM-DD than MM/DD/YYYY

tylerbarna avatar Jul 31 '23 22:07 tylerbarna

Seems worth implementing. USWDS does not provide strict guidance on only using a specific format, just describing the format used to the user clearly: https://designsystem.digital.gov/components/date-picker/

brandonlenz avatar Sep 29 '23 18:09 brandonlenz

@tylerbarna would #2726 deliver this feature fully for you?

werdnanoslen avatar Feb 23 '24 16:02 werdnanoslen

@tylerbarna would #2726 deliver this feature fully for you?

Yes, I believe so!

tylerbarna avatar Feb 23 '24 16:02 tylerbarna