change datepicker locale programatically
Hi,
I'm working on internationalizing an application and want to dynamically change the datepicker based on the locale selected by the user. i've included the required locale files after the jquery code, but the datepicker resorts to a locale that is dependent on which js file i include last.
example:
- <script type="text/javascript">
- $(function() {
- $.datepicker.setDefaults($.extend({changeMonth:true, changeYear:true, dateFormat:'M dd, yy'}, $.datepicker.regional['']));
- $("#radio_daterange_0_1").datepicker({changeMonth:true, changeYear:true, dateFormat:'M dd, yy'});
- $("#radio_daterange_0_2").datepicker({changeMonth:true, changeYear:true, dateFormat:'M dd, yy'});
- $("#radio_daterange_0_1").datepicker($.datepicker.regional['fr']);
- $("#radio_daterange_0_1").datepicker($.datepicker.regional['de']);
- });
- </script>
- <script src="/<s:property value='#session.locale'/>/js/reports/jquery.ui.datepicker-fr.js"></script>
- <script src="/<s:property value='#session.locale'/>/js/reports/jquery.ui.datepicker-de.js"></script>
Since the last locale file to be included is German(de.js), the datepicker resorts to german locale. How can this be overcome?
Regards,
Kiran Jakkula.