on 2004 Mar 26 1:48 PM
to make use of the Date Picker UI-Element I declared my Context-Field of type Date which is mapped to java.sql.Date. (Why?)
Now I want to show today's Date as default value.
The following code gives me e.g dd.MM.yy as value in my InputField. I want the format dd.MM.yyyy which is what DatePicker gives back.
How can I achieve that?
Regards
Michael
java.util.Calendar cal = new GregorianCalendar();
java.sql.Date bookingDate = new java.sql.Date(cal.getTime().getTime());
indeed. the date is displayed correctly now.
thank you.
Regards
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Stefan. So I guess that the Version is the problem. Your code produced the same result as mine before. I am still using the 2.0.2 version of the NDS with AppServer 6.30. You are using Sneak II I guess?
Regards
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
not really Sneak II, it's a 6.40 beta version. Anyway, your problem should have been solved in the productive release.
In the meantime you could try to create and use a simple type based on the builtin date type and a format pattern assigned (maybe dd.MM.yyyy) to it. I guess, the format should be used by the CSF for display.
Regards
Stefan
Hi Michael,
i tried this also, using a context attribute of builtin type "date" and an input field, but for me it works with the code or also with:
wdContext.currentContextElement.setDatum(new Date(System.currentTimeMillis()));
I get 26.03.2004, not 26.03.04. Which WebAS version are you using?
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.