Query Regarding org.eclipse.nebula.widgets.calendarcombo.CalendarCombo Date Format behavior [message #694953] |
Sun, 10 July 2011 10:56 |
eclipsefan Messages: 11 Registered: June 2011 |
Junior Member |
|
|
Hello Experts -
I have a requirement where in I need when a user picks a date in the calendar combo, it should be displayed as d-MMM-yyyy HH:mm (example: 21-Jul-2011 00:00) in the text control of the calendar combo widget.
I did the following while creating the calendarcombo instance -
CalendarCombo cc = new CalendarCombo(inner, SWT.NONE, new CustomSettings(), null);
where CustomSettings is defined as follows :
public class CustomSettings extends DefaultSettings {
public String getDateFormat()
{
return "d-MMM-yyyy";
}
}
Here is what I then do:
1. Pick a date. The system displays the date as 21-Jul-2011 00:00 in the text
control of the calendar combo widget.
2. Now I try to change the date by pulling up the widget. The system throws the
following error -
java.lang.NumberFormatException: For input string: "Jul"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.eclipse.nebula.widgets.calendarcombo.DateHelper.slashParse(DateHelper.java:561)
at org.eclipse.nebula.widgets.calendarcombo.DateHelper.parse(DateHelper.java:158)
at org.eclipse.nebula.widgets.calendarcombo.CalendarCombo.parseTextDate(CalendarCombo.java:859)
at org.eclipse.nebula.widgets.calendarcombo.CalendarCombo.showCalendar(CalendarCombo.java:1139)
at org.eclipse.nebula.widgets.calendarcombo.CalendarCombo$5.handleEvent(CalendarCombo.java:646)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at tablecombo.Tester.main(Tester.java:101)
Clearly, the code inside the calendar combo is facing problems with parsing the String "Jul". What am I missing in my code that can resolve this issue ? Please let me know.
Regards.
[Updated on: Sun, 10 July 2011 10:56] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04543 seconds