Mark
23 Aug 2007, 1:23 PM
Trying to edit a datefield in a grid I run into problems.
To send the data to the server I need convert the original value into the php default format "Y-m-d H:i"
I tried this before I submit the change to the server:
var datestring=""+oGrid_event.value+"" ;
var datepart=datestring.split(" ");
var monthName = new Array();
monthName["Jan"]="01";
monthName["Feb"]="02";
monthName["Mar"]="03";
monthName["Apr"]="04";
monthName["May"]="05";
monthName["Jun"]="06";
monthName["Jul"]="07";
monthName["Aug"]="08";
monthName["Sep"]="09";
monthName["Oct"]="10";
monthName["Nov"]="11";
monthName["Dez"]="12";
var datum=datepart[3]+'-'+monthName[datepart[1]]+'-'+datepart[2]+' '+datepart[4];
oGrid_event.value=datum ;
This works so far but in IE6.0 there is a big surprise because the format of the value changed!
I append screenshots from the different formats.
I browsed the forum but I found no solution to this. Instead of an answer I met another guy who has similar problems and he still waits for answer
http://extjs.com/forum/showthread.php?t=10860&highlight=edit+datefield
Please help !
Thanks in advance,
Mark
To send the data to the server I need convert the original value into the php default format "Y-m-d H:i"
I tried this before I submit the change to the server:
var datestring=""+oGrid_event.value+"" ;
var datepart=datestring.split(" ");
var monthName = new Array();
monthName["Jan"]="01";
monthName["Feb"]="02";
monthName["Mar"]="03";
monthName["Apr"]="04";
monthName["May"]="05";
monthName["Jun"]="06";
monthName["Jul"]="07";
monthName["Aug"]="08";
monthName["Sep"]="09";
monthName["Oct"]="10";
monthName["Nov"]="11";
monthName["Dez"]="12";
var datum=datepart[3]+'-'+monthName[datepart[1]]+'-'+datepart[2]+' '+datepart[4];
oGrid_event.value=datum ;
This works so far but in IE6.0 there is a big surprise because the format of the value changed!
I append screenshots from the different formats.
I browsed the forum but I found no solution to this. Instead of an answer I met another guy who has similar problems and he still waits for answer
http://extjs.com/forum/showthread.php?t=10860&highlight=edit+datefield
Please help !
Thanks in advance,
Mark