Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4100

strictDate evaluated too early in ZK-4023

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.0
    • Fix Version/s: 8.6.1
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      Steps to Reproduce

      run following datebox with 8.6.0.FL.20181023

      <datebox lenient="true" strictDate="true" format="dd.MM.yyyy"></datebox>

      input the date: 31.11.2018

      Current Result

      Datebox will switch to 01.12.2018

      Expected Result

      Datebox should reject the date (strictDate=true)

      Debug Info

      strictDate is evaluated before formatting.
      If the formatted date is different than the input string, the result date may rejected while it is valid, or not rejected while it is not valid.

      strictDate:
      https://github.com/zkoss/zk/blob/master/zul/src/archive/web/js/zul/db/datefmt.js#L325

      formatting:
      https://github.com/zkoss/zk/blob/master/zul/src/archive/web/js/zul/db/datefmt.js#L389-L396

      Could be improved by checking the same values checked during strict mode checks here:
      https://github.com/zkoss/zk/blob/master/zul/src/archive/web/js/zul/db/datefmt.js#L389-L396

      Root Cause

      Workaround

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rudyhuang rudyhuang
              Reporter:
              MDuchemin MDuchemin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h