We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c09ac2f commit 3893d07Copy full SHA for 3893d07
src/utils/locales.js
@@ -94,6 +94,10 @@ const getDayNames = (locale, length) => {
94
return getWeekdayDates({ utc: true }).map(d => dtf.format(d));
95
};
96
97
+/* eslint-disable no-bitwise */
98
+const DoFn = d =>
99
+ `${d}${[null, 'st', 'nd', 'rd'][((d % 100) >> 3) ^ 1 && d % 10] || 'th'}`;
100
+
101
export default locale => {
102
const detectedLocale = new Intl.DateTimeFormat().resolvedOptions().locale;
103
const searchLocales = [
@@ -124,5 +128,6 @@ export default locale => {
124
128
dayNamesNarrow,
125
129
monthNames,
126
130
monthNamesShort,
131
+ DoFn,
127
132
133
0 commit comments