EasyUI Forum

General Category => Bug Report => Topic started by: ClSoft on February 26, 2013, 02:18:22 AM



Title: Datebox example
Post by: ClSoft on February 26, 2013, 02:18:22 AM
Hi development,
Date format example have bug:
http://www.jeasyui.com/demo/main/index.php?plugin=DateBox&theme=default&dir=ltr&pitem=
(Date format example)

instead of two "ss"
var y = parseInt(ss[0],10); 
var m = parseInt(ss[1],10); 
var d = parseInt(ss[2],10); 

it should be one "s"
var y = parseInt(s[0],10); 
var m = parseInt(s[1],10); 
var d = parseInt(s[2],10); 


Title: Re: Datebox example
Post by: stworthy on February 26, 2013, 07:20:29 AM
The 'ss' variable is right. The 'myparser' function is declared as:
Code:
function myparser(s){
if (!s) return new Date();
var ss = s.split('-');
var y = parseInt(ss[0],10);
var m = parseInt(ss[1],10);
var d = parseInt(ss[2],10);
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
return new Date(y,m-1,d);
} else {
return new Date();
}
}


Title: Re: Datebox example
Post by: ClSoft on February 26, 2013, 07:57:01 AM
Hi
not sure that we are talking about same thing - please see image:


Title: Re: Datebox example
Post by: stworthy on February 26, 2013, 08:07:01 AM
There is a little mistake while highlighting the code. Now it has been fixed.


Title: Re: Datebox example
Post by: ClSoft on February 26, 2013, 08:20:46 AM
Thanks  :)