Uso do jQuery Datepicker localizado para pt-BR

1,679 views
Skip to first unread message

Luiz Cunhalima

unread,
Apr 29, 2009, 10:05:57 AM4/29/09
to rails-br
Pessoal,

Já realizei algumas pesquisas no site do jQuery, em fóruns da
comunidade jQuery, no Google, mas não estou conseguindo saber o motivo
de não estar conseguindo usar o datepicker localizado para pt-BR no
Rails.

Segue o código da view:

<head>
<%= stylesheet_link_tag 'jquery-ui-1.7.1.custom' %>
<%= javascript_include_tag 'jquery', 'jquery-ui-1.7.1.custom' %>
</script>
<script type = "text/javascript">
jQuery(function(){
$.datepicker.setDefaults($.extend({showMonthAfterYear: false},
$.datepicker.regional['']));
$("#xxx").datepicker($.datepicker.regional['pt-BR']);
});
</script>
</head>
<div>
<%= text_field_tag :xxx, nil, :id => 'xxx'%>
</div>

Ele sempre apresenta a localização padrão. Peguei o arquivo
"ui.datepicker-pt-BR.js" e coloquei em diversas pastas: "public/
javascripts", "public/javascripts/js", public/javascripts/js/i18n" e
não obtive sucesso.

Agradeço antecipadamente as orientações.

Sds, Luiz Cunhalima

Cássio Marques

unread,
Apr 29, 2009, 10:12:13 AM4/29/09
to rail...@googlegroups.com
Já tentou?

<%= javascript_include_tag 'ui.datepicker-pt-BR' %>

considerando que ele esteja em public/javascripts.

Você tem que incluir o arquivo de internacionalização para pt-BR na sua página também.

2009/4/29 Luiz Cunhalima <luizcu...@hotmail.com>



--
Cássio Marques

Blog: http://cassiomarques.wordpress.com

If you're writing code and you're not testing it, the code is wrong. I don't care if it does the right thing, and people need to understand this. If it works by accident, you're still wrong.
Bryan Liles - Ruby Hoedown 2008
Reply all
Reply to author
Forward
0 new messages