here are the changes I made to allow d-m-Y dates rather than m/d/Y
** note, you have to use '-' as the separator rather than '/' as the php function strtotime (which is used to check the dates) will not work otherwise
1) change to /scp/js/calendar.js
replace function lcs with code below
function lcs(ielem) {
updobj=ielem;
getObj('fc').style.left=Left(ielem)+'px';
getObj('fc').style.top=Top(ielem)+ielem.offsetHeight+'px';
getObj('fc').style.display='';
// First check date is valid
curdt=ielem.value;
curdtarr=curdt.split('-');
isdt=true;
for(var k=0;k<curdtarr.length;k++) {
if (isNaN(curdtarr))
isdt=false;
}
if (isdt&(curdtarr.length==3)) {
ccm=curdtarr-1;
ccy=curdtarr;
prepcalendar(curdtarr,curdtarr-1,curdtarr);
}
}
2) change to /scp/js/calendar.js
replace function prepcalendar with code below
function prepcalendar(hd,cm,cy) {
now=new Date();
sd=now.getDate();
td=new Date();
td.setDate(1);
td.setFullYear(cy);
td.setMonth(cm);
cd=td.getDay();
getObj('mns').innerHTML=mn+ ' ' + cy;
marr=((cy%4)==0)?mnl;
for(var d=1;d<=42;d++) {
f_cps(getObj('v'+parseInt(d)));
if ((d >= (cd -(-1))) && (d<=cd-(-marr))) {
dip=((d-cd < sd)&&(cm==sccm)&&(cy==sccy));
htd=((hd!='')&&(d-cd==hd));
if (0 && dip)
f_cpps(getObj('v'+parseInt(d)));
else if (htd)
f_hds(getObj('v'+parseInt(d)));
else
f_cps(getObj('v'+parseInt(d)));
getObj('v'+parseInt(d)).onmouseover=cs_over;
getObj('v'+parseInt(d)).onmouseout=cs_out;
getObj('v'+parseInt(d)).onclick=cs_click;
getObj('v'+parseInt(d)).innerHTML=d-cd;
calvalarr=''+(d-cd)+ '-'+(cm-(-1))+'-'+cy;
}
else {
getObj('v'+d).innerHTML=' ';
getObj('v'+parseInt(d)).onmouseover=null;
getObj('v'+parseInt(d)).onmouseout=null;
getObj('v'+parseInt(d)).style.cursor='default';
}
}
}
3) change to /include/staff/editticket.inc.php
change
'duedate' =>$ticket->getDueDate()?(Format:('m/d/Y',Misc:($ticket->getDueDate()))):'',
to
'duedate' =>$ticket->getDueDate()?(Format:('d-m-Y',Misc:($ticket->getDueDate()))):'',
I think that was all i changed, give it a try
regards
Tony C
another change i missed
in /include/class.ticket.php
in function update, change
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be MM/DD/YY');
to
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date');
in function create, change
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be MM/DD/YY');
to
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date');