fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

DatePicker: Use ECMAScript Internationalization API to localize DatePicker strings

Open MLoughry opened this issue 10 years ago • 5 comments

Rather than have the consumer provide a whole host of strings for the DatePicker, it can all be done with ECMADate.toLocaleString. Then, the consumer need only provide the 'goToToday' string and the locale.

http://stackoverflow.com/a/18648314 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString

MLoughry avatar Oct 07 '16 18:10 MLoughry

The blocker on this one is that these aren't supported below IE11. We could provide a HOC that derives values and prepops the DatePicker's string callbacks so that if your minbar is IE11 it's easier.

dzearing avatar Oct 24 '16 18:10 dzearing

One additional issue to consider here is that applications like OWA allow the user to choose formatting options in its Regional Settings and it takes that into consideration when displaying things like the Month/Year in the header of the mini-month calendar.

For example, it might be tempting to format the header in CalendarDay with navigatedDate.toLocaleString(userCulture, { month:"long", year:"numeric" }) (assuming we were to pass the desired culture as a property), so we get the string with correct order (for example, in zh-MU the year comes before the month). However, it would still not know about the user's preference in OWA. We would get 'August 2017' in English, but if OWA's regional settings ask for dates to be formatted as "yyyy-MM-dd" then OWA is supposed to show '2017 August', as in fact it does today: image

So it almost sounds like we need to let the application do the formatting or we'll need to give a lot more options on how dates are formatted, in order to account for OWA regional settings.

fpintos avatar Aug 25 '17 01:08 fpintos

Assigning to @johannao76, please free to assign to someone else or close it if it doesn't make sense anymore.

gokunymbus avatar Jan 11 '18 19:01 gokunymbus

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React!

stale[bot] avatar Apr 11 '18 02:04 stale[bot]

This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Fabric React! Why am I receiving this notification?

stale[bot] avatar May 18 '18 22:05 stale[bot]