-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I have observed some strange beheaveour in datebox. Ww have two datebox. One from a date and the other to a date. When I try to put the date (27/08/0200) into the from datebox i set a constraint into the to datebox and javascript throws a error like this: http://imageshack.us/photo/my-images/109/zkerror27082012.png/
this is my code:
anyo = "0200"; mes = "08"; dia = "27"; String constraint = anyo+mes+dia; dbHasta.setConstraint("after " + constraint); System.out.println("after " + constraint);
And I can show in the console: after 2000827
Is this a bug?
regards, Marky
Hi vincentjian,
I solved it!
The problem is when I parse the String with "String.valueOf(gregorianCalendar.get(Calendar.YEAR));". This returns the String without 0 at the beginnin of the string, and the method setConstraint() needs 4 chars for year.
Now i do this:
if(year.length() < 4){ for(int i = 0; i < 4 - year.length(); i++ ){ year= "0" + year; } }
Regards,
Marky
Hi Marky,
I tried to set constraint when "from" datebox is changed and works correctly. Can you provide more detailed sample code?
Note that the constraint showed in the console is not correct, should be after 02000827.
Asked: 2012-08-27 08:23:14 +0800
Seen: 95 times
Last updated: Aug 29 '12