1

I've already tried everything and nothing works...Here goes the code of my last try:

Head

<link type="text/css" href="css/smoothness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript">

     $(function() {      

           $('#datepicker').datepicker($.extend({

               dateFormat: 'dd/mm/yy',
               inline: true,
               showOtherMonths: true,
               selectOtherMonths: true

           },$.datepicker.regional['pt']));

           $('#datepicker2').datepicker($.extend({
                dateFormat: 'dd/mm/yy',
                inline: true,
                showOtherMonths: true,
                selectOtherMonths: true                    

           },$.datepicker.regional['pt']));   
 });

XHTML

<p>Data de admissão: <br></br>
<input id="datepicker" rendered="true" value="#{professor.admissao}"></input>
</p>

<p>Data de exoneração:<br></br>
<input id="datepicker2" rendered="true" value="#{professor.exoneracao}"></input>
</p>

Anyone knows why it isn't works?

Ps: In this project I'm using JSF 2.0, Glassfish 3.0.1, Primefaces 3.3 and jQuery.

João Almeida
  • 45
  • 1
  • 1
  • 8
  • possible duplicate of [Jquery datepicker localization](http://stackoverflow.com/questions/1452681/jquery-datepicker-localization). Your code works fine with the correct localization file included: http://jsfiddle.net/yF97s/ – Andrew Whitaker Aug 11 '12 at 23:35
  • You mean duplicate code or duplicated config file? In code this is the unique local that I've defined the datapicker localization. Sorry for this doubt. I'm a beginer :) – João Almeida Aug 12 '12 at 00:14
  • No problem! I think you are having the same problem as the other question points out. – Andrew Whitaker Aug 12 '12 at 00:14
  • Using '$.datepicker.regional['pt'] = {clearText: 'Effacer', clearStatus: '', monthNames:[], dayNames:[], ....}' works, but I have to edit all attributes. I was wondering if there isn't any function which I can change the language just defining the language as an attribute like '$( "#datepicker" ).datepicker( $.datepicker.regional[ "pt" ] );'. But thanks, at least I can change the language now. – João Almeida Aug 12 '12 at 01:40

0 Answers0