ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

Time translation #137

Closed enriquesomolinos closed 7 years ago

enriquesomolinos commented 7 years ago

As you add the functionality of translating months and days, the time frame is not translatable. Labels "Time","Hour","Min" cannot be translated.

It's posible to add this strings like the months and days of the week ?

Thanks.

allenhwkim commented 7 years ago

Yes we can, but there are many ways to do it

  1. Change HTML to css pseudo code, e.g. using :before, so that user can change css.
  2. MomentJS has these terms? then make use of it
  3. Accept parameter from user

Any suggestion?

enriquesomolinos commented 7 years ago

I think the best way to do this is following the same solution as you use for months and days labels:

{{monthData?.shortName}}

You can do a little change like this:

{{timeLabels?.title}} {{timeLabels?.hours}} {{timeLabels?.minutes}}

As far as i know, momentjs hasn't this labels defined.

Thanks for all!

allenhwkim commented 7 years ago

@enriquesomolinos thanks, I will think about the suggested way.