Click
  1. Click
  2. CLK-191

Time entry component renders %e %b %Y %H:%M NaN

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      I've noticed a small bug in the DateField with time.

      There's a feature to click and drag to adjust the hour and minute settings.

      However, if the drag is lifted (i.e. dropped) far right of the calendar control, the content becomes %e %b %Y %H:%M NaN

        Activity

        Hide
        Adrian A. added a comment -

        Issue is obsolete since that calendar JS is not part of Apache Click.

        Show
        Adrian A. added a comment - Issue is obsolete since that calendar JS is not part of Apache Click.
        Hide
        Malcolm Edgar added a comment -

        Hi Bernard,

        thanks for the patch can you tell me what column number this change is applied, as I have a number of calendar js file to update.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Hi Bernard, thanks for the patch can you tell me what column number this change is applied, as I have a number of calendar js file to update. regards Malcolm Edgar
        Hide
        Bernard Choi added a comment -

        Patch to resolve the issue.

        The calendar determines the target of the drag and drop location, and attempts to treat it like a "year" component. However, if the target of the drop is not the year component, the script still performs a

        date.setFullYear(year.year); // IsNaN !!

        which results in the odd format.My fix is to replace

        if (year)

        with

        if (year && !isNaN(year.year))

        Show
        Bernard Choi added a comment - Patch to resolve the issue. The calendar determines the target of the drag and drop location, and attempts to treat it like a "year" component. However, if the target of the drop is not the year component, the script still performs a date.setFullYear(year.year); // IsNaN !! which results in the odd format.My fix is to replace if (year) with if (year && !isNaN(year.year))

          People

          • Assignee:
            Malcolm Edgar
            Reporter:
            Bernard Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development