Here’s an awesome peace of code I use every time if using the jquery datepicker.
I don’t originally know where I got the snippet from but in this case it should help ( I think )
$('.date-human').datepicker({
'dateFormat':'yy-mm-dd'
});
function convert_date(){
var $this=$(this);
var id='date-input-'+Math.random().toString()
.replace(/\./,'');
var dparts=$this.val().split(/-/);
$this
.datepicker({
dateFormat:'yy-mm-dd',
modal:true,
altField:'#'+id,
altFormat:'DD, d MM, yy',
onSelect:function(dateText,inst){
this.value=dateText;
}
});
var $wrapper=$this.wrap(
'<div style="position:relative" />');
var $input=$('<input id="'+id+'" class="date-human-readable"
value="'+date_m2h($this.val())+'" />');
$input.insertAfter($this);
$this.css({
'position':'absolute',
'opacity':0
});
$this
.datepicker(
'setDate', new Date(dparts[0],dparts[1]-1,dparts[2])
);
}
$(function(){
$('input.date-human').each(convert_date);
});
So instead of the db version of yyyy-mm-dd you get day, month, year
I don’t know if modx already does this but I think this should help you get what you’re wanting to achieve.