Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: EE-4.0.0.GA
-
Fix Version/s: EE-4.0.0.GA
-
Component/s: Sample Apps
-
Labels:None
-
Environment:ICEfaces 4 trunk r44258. Tomcat 7, IE 11, FF 34, Chrome 41. showcase ace:dateTimeEntry > Time Entry demo
-
Assignee Priority:P1
-
Affects:Sample App./Tutorial
Description
Using showcase ace:dateTimeEntry > Time Entry demo causes date to reset from current date to Jan 1970.
To reproduce:
1.) Load demo, notice that the date rendered on the calendar header is the current date.
2.) Select the Time only radio button
3.) Change the time and submit.
4.) Use either the Time and Date or Date Only radio buttons.
5.) Notice that the date has been reset to January 1970.
To reproduce:
1.) Load demo, notice that the date rendered on the calendar header is the current date.
2.) Select the Time only radio button
3.) Change the time and submit.
4.) Use either the Time and Date or Date Only radio buttons.
5.) Notice that the date has been reset to January 1970.
r44309: committed app-level fix to preserve date parameters and time parameters when the component is is time-only and date-only mode, respectively.
The issue had to be fixed at the application level. The component is just working the way it's supposed to work and there's no feasible way to make it preserve a date when switching to time-only mode or to preserve the time when switching to date-only mode. The component uses three different widgets in the client side (timepicker, datepicker, and datetimepicker) and each of them interprets and returns the value of the component in a different way way. The component will read the value in the pattern given, and will set the value in the same pattern. In time-only mode the date format is not included in the pattern, since the date is irrelevant, it is set to the default value (Jan 1, 1970). Likewise, in date-only mode, the time format is not included in the pattern, and it is set to the default value (00:00:00, adjusted for locale). In this specific case, the calendar switches between the 3 modes for demonstration purposes, but it's impossible to make assumptions in the component code about what date or time to set if they weren't explicitly given by the client side. Therefore, a custom fix in the demo itself was the most appropriate solution.