material-datetime-picker
material-datetime-picker copied to clipboard
Translate the component using locales and translations
Hey there!
I created this PR from my crazy idea of #127. In fact, it wasn't as crazy as I thought. Actually, you can create a picker passing a moment object as default paramater. All I did was using this moment object in the points where a translation is needed. As well, I included two new parameters in the constructor to translate the button labels.
Thanks for the new PR! I'm having a very busy week, but I'll review it when I get the chance. ⭐️
I want this ! 👍
Just wanted to say thanks for this @Luisetelo!
Working on an improved version...!
Hey there!
Here is the new version of the feature. The changes I've made are:
- Added translations for Ok and Cancel buttons
- Added translations for the calendar (day names, first day of the week)
- Added day number format
- Added documentation of new parameters at README.md
- Updated moment.js dependency (see below)
- Deleted compiled files for the PR
- Deleted blank spaces in lines
Drawback
In order to use this new feature, moment.js dependency should be updated . Why? To set the day names translations in the calendar, the function moment.weekdaysMin() is used. This function list the day names from the current locale. However, this behavior is only available in moment.js 2.13.0 and above (see)
Looking forward to hearing from you!