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

strictDate evaluated too early in ZK-4023

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 8.6.0
    • None
    • Security Level: Jimmy
    • None

      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

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

              Created:
              Updated:
              Resolved:

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