-
Notifications
You must be signed in to change notification settings - Fork 99
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
Ordinal dates? #10
Comments
Also, we need to decide the appropriate directive. I think I believe we only need an ordinal suffix for day-of-month, so the |
For German locales it's just an added ".". |
From my tests the implementation above doesn't work for the values const ordinalSuffixes = ['th', 'st', 'nd', 'rd'];
function ordinalSuffix(number) {
const value = number % 100;
return ordinalSuffixes[(value - 20) % 10] || ordinalSuffixes[value] || ordinalSuffixes[0];
} |
I was missing some parens. Added. |
Ah nice. 👍 |
In Bulgarian the suffix changes with each day: 1 2ри 3ти 4ти 5ти 6ти 7ми 8ми 9ти 10ти 11ти 12ти 13ти 14ти 15ти 16ти 17ти 18ти 19ти 20ти 21ви 22ри 23ти 24ти 25ти 26ти 27ми 28ми 29ти 30ти 31ви (pronounced "pi", "mi", "ti", "bi"…) |
Ref #12 |
Related d3/d3#495. TODO:
%o
)This implementation works in English:
However, it’s not clear how we should localize this behavior. Perhaps the locale definition can include a JavaScript function?
The text was updated successfully, but these errors were encountered: