05-02-2012 09:09 PM
I'd like to create a date field with the day of the week. Currently I can make one with the day of month, month and year but I'd like to have one with the day of the week, day of month, month and year.
Right now I have:
DateField dateField = new DateField("Go to:",System.currentTimeMillis(), DateField.DATE);
Can I adapt this to include the day of week too?
05-03-2012 04:24 AM
Check out the setFormat function with the DateFormat API:
05-06-2012 01:35 AM
Actually, more like:
Another option, which I prefer, is:
dateField.setFormat(new SimpleDateFormat("your Date Format Pattern Here"));
The simpleDateFormat class lets you define your own preferred date pattern:
05-13-2012 10:58 AM
But tha still doesn't seem to be working. I'm using Eclipse and it gives me the error
"Syntax error on token "setFormat", Identifier expected after this token"
I used dateField.setFormat(DateFormat.getInstance(DateFor
It seems to be a problem with setFormat, not anything else.