views:

74

answers:

4

Hi guys, I am using the UI datepicker and I have already limited the date range possible, bt now, I also want to change the format becuase my mysql database is not storing the dates as the format is not the ISO format(yyyy-mm-dd), it is more like(dd-mm-yy), here is my code please! :

$(function() { $("#datepicker").datepicker({minDate: +7, maxDate: '+4M +10D'}); });
+1  A: 

Check - http://docs.jquery.com/UI/Datepicker/$.datepicker.formatDate

Easy as replace dd/mm/yy with format of choice :)

.datepicker({ dateFormat: 'dd/mm/yy' });
Si Philp
+1  A: 

Please have a look the site:

$('#datepicker').datepicker('option', {dateFormat: 'yyyy-mm-dd'});
Bobby
A: 

thank you guys, but what worked for min the end was changing the format in the ui datepicker.js script, it was that simple. thank you for anwering though

Nwakego
A: 

Well in do in the version for MooTools editing the .js script:

// MooTools.lang this.setOptions({ days: MooTools.lang.get('Date', 'days'), months: MooTools.lang.get('Date', 'months'), //format: MooTools.lang.get('Date', 'shortDate'), format: '%d-%m-%Y', selectTimeTitle : MooTools.lang.get('DatePicker', 'select_a_time'), timeConfirmButton : MooTools.lang.get('DatePicker', 'time_confirm_button') });

Mikel