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

Datebox today link date-format

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.4
    • 8.0.3
    • Components
    • Security Level: Jimmy
    • ZK 8.0.4 S1

      Steps to Reproduce

      <datebox showTodayLink="true" format="dd/MM/yyyy HH:mm"/>
      

      open the datebox dropdown

      Actual Result

      the date of the today link is formatted including the ":" at the end

      Expected Result

      only display the date

      Root Cause

      these 2 methods attempt to perform the splitting between date and time format
      https://github.com/zkoss/zk/blob/master/zul/src/archive/web/js/zul/db/Datebox.js#L300
      https://github.com/zkoss/zk/blob/master/zul/src/archive/web/js/zul/db/Datebox.js#L332

      I don't think all possible date format strings can be split in a reliable way.
      It should be possible to define a date and time format separately if the default mechanism fails.

      Workaround

      Override the getDateFormat and getTimeFormat JS functions to return the expected value
      The attachment datebox-today-label.zul shows 2 alternatives

      1. splitting by space (where applicable)
      2. define a custom dateFormat using a widget attribute

            DevChu DevChu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h