JMarques
JMarques

Reputation: 3064

keith-wood date picker dateFormat and language

I'm using the Keith-Wood date picker and i´ve a problem with dateFormat.

When i use the following script everthing works fine:

$('#popupDatepicker').datepick({dateFormat: "yyyy-mm-dd"});

(when a select a date the result is, for example, 2012-09-06)

but when i include the language setting the dateFormat is ignored

$('#popupDatepicker').datepick($.extend({dateFormat: "yyyy-mm-dd"}, $.datepick.regional['pt-BR']));

In this case, when a select a date the result is, for example, 09/06/2012 (corresponding to the default dateFormat mm/dd/yyyy).

Anyone have a clue?

Thanks.

Upvotes: 1

Views: 1211

Answers (1)

JMarques
JMarques

Reputation: 3064

I found one solution (not sure if it's the best one) but...

$.datepick.setDefaults($.datepick.regional['pt-BR']);   
$('#popupDatepicker').datepick({dateFormat: "yyyy-mm-dd",altFormat: "yyyy-mm-dd"});

Upvotes: 2

Related Questions