-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add formatters: fullDateWithWeekday, weekday and weekdayShort #399
Comments
@philipbulley thanks for this issue! we definitely need it. It will be really cool if you will open PR with functionality. Thanks ❤️ |
@dmtrKovalenko I've also just noticed that the existing Given these docs: /** Localized full date, useful for accessibility @example "January 1st, 2019" */
fullDate: TLibFormatToken; The tests have assertions that don't match the example in the docs: date-io/__tests__/formats.test.ts Line 40 in e8ce35c
Making If you're not keen on making a breaking change here, would it be a good idea to introduce formatters named |
There is |
date-io/packages/core/IUtils.d.ts Lines 42 to 43 in e8ce35c
Yeah, I'm thinking more about text-to-speech, as such I think the problem above can be resolved by improving the docs, which I've now done in the PR. |
Already released |
I'd like to request a few additional formats to be added as follows:
Why?
I'm creating a Date Picker (for React Native) and feel its important for accessibility that the weekday, month, day, and year can be read out aloud by a screen reader.
Why not just pass a custom format string?
I don't want end-users of the date picker to have to pass in a custom formatter string to achieve this, simply because accessibility is often ignored and this issue will rarely be visible to developers. We really need to ship with a good default.
Why aren't the existing
defaultFormats
suitable?fullDate
outputsJanuary 1st, 2019
and doesn't contain the weekdaynormalDateWithWeekday
outputsWed, Jan 1st
and as such is not suitable for screen readers due to the abbreviations of weekday and monthdefaultFormats
that can output the weekday alone which would otherwise allow a suitable string to be built through multipleformat()
calls@dmtrKovalenko, if you're fine with this addition, I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered: