g00fy- / angular-datepicker

calendar and datepicker directives for angular
MIT License
722 stars 421 forks source link

datepicker int brazilian portuguese #317

Open benhurazevedo opened 7 years ago

benhurazevedo commented 7 years ago

hi

I'm using g00fy-angular-datepicker but it is in english. How can i translate it to brasilian portuguese? i'm using angular-locale_pt-br.js in my code. But it doesn't work with the datepicker.

iArtur commented 7 years ago

Someone?

benhurazevedo commented 7 years ago

yes?

iArtur commented 7 years ago

I want to know if anyone can awnser that question cause i'm interested to.

DanTalash commented 7 years ago

All localization is handled by moment.js. It appears that Portuguese (Brazil) is an existing localization, so you do not need to do any translation yourself, just load the appropriate locale file, and set the locale to pt-br.

For more information see the moment.js i18n docs.

renersilva commented 7 years ago

Hi @benhurazevedo @iArtur

First you must download this js file and use it instead of moment.js After you download and include this file in your project, add the following line to configure the Moment JS to "pt-BR" globaly:

moment.locale('pt-BR');

I experienced an issue when using lazy loading. Sometimes I get a "cannot read property isMoment of undefined", even when loading Moment script before angular-datepicker script. So I decided to use moment globaly and I declared it in the index.html file of my Angular project. The locale configuration was set in index.html as well.

Sorry for answering only now, but I saw this issue today