-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5037892
By: enixser
I have defined a Datebox with the format string "dd-MMM-yyyy" which produces values like "17-Jun-2008". Is there a way to tell the Datebox to accept "17-jun-2008"
and "17-JUN-2008" as well when entered manually? If not, which method should I override in a derived class?
Best regards,
Ralf.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5043245
By: jebberwocky
Take a look the Javadoc
http://www.zkoss.org/javadoc/3.0.5/zul/org/zkoss/zul/Datebox.html#setFormat(java
.lang.String)
and
developer guide
http://www.zkoss.org/doc/devguide/ch07s01s07.html
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5053099
By: enixser
I know these documents, but I cannot find any hint that solves my problem. When I define the format as "dd-MMM-yyyy" the datebox only accepts date strings that match the exact case of the month like in this example: "17-Jun-2008". I did not find any format telling the datebox to be case insensitive to also accept "17-jun-2008" and "17-JUN-2008".
I guess it's not possible with a format string as this is not supported by Java.
So, the question is: At which point can I put my hands on to prepare the date string before it is parsed? Which method has to be overridden?
Best regards,
Ralf.
I want to ask again as I did not get a satisfying answer yet:
Can anyone of the ZK guys point me to a method where the text string of the input field is parsed to the internal Date value. I guess I have to override this method to achieve the expected behavior.
Best regards,
Ralf.
Hi,
There is a bug about datebox format in some locale (https://sourceforge.net/tracker/index.php?func=detail&aid=2009503&group_id=152762&atid=785191)
However this is not the issue you have.
In your case, for cusomization, you can override zk.parseDate (refer the source in common.js) , in switch case 'M'.
Modify both 'if (zk.SMON.split(/\W+/)[0] == token) { ' to string uppercase compare, then it should work.
You could also track the bug above , to know which version you can remove this customization.
/Dennis
Asked: 2008-06-17 12:37:39 +0800
Seen: 262 times
Last updated: Jul 03 '08