material-datetime-picker icon indicating copy to clipboard operation
material-datetime-picker copied to clipboard

Translate the component using locales and translations

Open Luisetelo opened this issue 8 years ago • 5 comments

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.

Luisetelo avatar Mar 06 '17 13:03 Luisetelo

Thanks for the new PR! I'm having a very busy week, but I'll review it when I get the chance. ⭐️

joews avatar Mar 06 '17 20:03 joews

I want this ! 👍

falko100 avatar May 02 '17 11:05 falko100

Just wanted to say thanks for this @Luisetelo!

arist0tl3 avatar May 14 '17 17:05 arist0tl3

Working on an improved version...!

Luisetelo avatar May 26 '17 12:05 Luisetelo

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!

Luisetelo avatar May 29 '17 09:05 Luisetelo