ICEfaces
  1. ICEfaces
  2. ICE-10573

Regression ace:dateTimeEntry date is reset to Jan 1970 after submitting time change

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

        Activity

        Hide
        Arturo Zambrano added a comment -

        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.

        Show
        Arturo Zambrano added a comment - 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.
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces EE-4.0.0 Jenkins build 2. Tomcat 7, IE 11. FF 34, Chrome 41.

        Show
        Liana Munroe added a comment - Verified ICEfaces EE-4.0.0 Jenkins build 2. Tomcat 7, IE 11. FF 34, Chrome 41.
        Hide
        Liana Munroe added a comment -

        Tested with ICEfaces EE-4.0.0 Jenkins build 4. Tomcat 7, all browsers.
        New issue in dateTimeEntry > Time Entry demo
        When using the Date Only calendar, picking a date then submitting, the date chosen is not updated on the page. Instead the next day's date is rendered instead.
        Example:
        Today's date is April 1. Using Date Only demo I choose April 16 and press submit. The Selected Date and Time on the page is updated to April 2.

        Show
        Liana Munroe added a comment - Tested with ICEfaces EE-4.0.0 Jenkins build 4. Tomcat 7, all browsers. New issue in dateTimeEntry > Time Entry demo When using the Date Only calendar, picking a date then submitting, the date chosen is not updated on the page. Instead the next day's date is rendered instead. Example: Today's date is April 1. Using Date Only demo I choose April 16 and press submit. The Selected Date and Time on the page is updated to April 2.
        Hide
        Arturo Zambrano added a comment -

        Committed fix to take the new date when adjusting the selected date, to the 4.0 trunk at revision 44372 and to the 4.0 EE tag at revision 44373.

        Show
        Arturo Zambrano added a comment - Committed fix to take the new date when adjusting the selected date, to the 4.0 trunk at revision 44372 and to the 4.0 EE tag at revision 44373.
        Hide
        Carmen Cristurean added a comment -

        Testing with Jenkins EE-4.0.GA Build 5:

        showcase > dateTimeEntry > TimeEntry (all browsers):
        When using only the "Date Only" calendar, submitting a new date renders the next day on the page.

        As example, clicking on April 15 in the calendar renders on page:
        Selected Date and Time: April 16, 2015

        Show
        Carmen Cristurean added a comment - Testing with Jenkins EE-4.0.GA Build 5: showcase > dateTimeEntry > TimeEntry (all browsers): When using only the "Date Only" calendar, submitting a new date renders the next day on the page. As example, clicking on April 15 in the calendar renders on page: Selected Date and Time: April 16, 2015
        Hide
        Arturo Zambrano added a comment -

        r44382, r44383: removed date adjustment after setting the time parameters.

        On my computer, it was necessary to adjust the date, after setting the time parameters. Try now to see if it works right for you.

        Show
        Arturo Zambrano added a comment - r44382, r44383: removed date adjustment after setting the time parameters. On my computer, it was necessary to adjust the date, after setting the time parameters. Try now to see if it works right for you.
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces EE-4.0.0 r44383. Tomcat 7, FF 34, Chrome 41, IE 11.

        Show
        Liana Munroe added a comment - Verified ICEfaces EE-4.0.0 r44383. Tomcat 7, FF 34, Chrome 41, IE 11.
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces EE-4.0.0 Jenkins build 6. Tomcat 7. FF 34, Chrome 41, IE 11.

        Show
        Liana Munroe added a comment - Verified ICEfaces EE-4.0.0 Jenkins build 6. Tomcat 7. FF 34, Chrome 41, IE 11.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Liana Munroe
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: