Recently I discovered some strange behavior of cforms. I have a date element in my form, in most cases entered date is correctly passed to bind etc. But some dates are modyfied by CForms engine (?) and are bad.
For example date 1993-10-15 change into 1993-10-14. Most often the broker date is decreased by one day from correct, but sometimes it is decreased by one month.
I performed several test and I think it is some issue connected with FormattingDateConvertor class. I tried to spot error again outside cocoon, but my efforts was unsuccesful. So I focused back on Cocoon and I began debugging Flowscript with Rhino debugger. And I have this results (these are examples copy from watches window):


INPUT : this.getChild("DATA").getDatatype().convertFromString("1993-10-15", new Packages.java.util.Locale("pl")).getResult()
RESULT : Thu Oct 14 23:00:00 CET 1993 (error)


INPUT : this.getChild("DATA").getDatatype().convertFromString("1993-10-12", Packages.java.util.Locale.getDefault()).getResult()
RESULT : Mon Oct 11 23:00:00 CET 1993 (error)


INPUT: this.getChild("DATA").getDatatype().convertFromString("1993-11-12", Packages.java.util.Locale.getDefault()).getResult()
RESULT:Fri Nov 12 00:00:00 CET 1993 (correct)


I have no ideas about the cause of this errors, I think that strange hour 23:00:00 (in date filed) suggest that it is some locale and time issue. This errors appears in some years most often i autumn months.

I am using Cocoon 2.1.5, the error appears both on Windows and Linux machine (JVM SUN 1.4.2).

Regars Jakub Kaniewski

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to