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

update moment.js and moment-timezones-with-data.js

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.2
    • None
    • Components
    • Security Level: Jimmy
    • None
    • ZK 8.6.2 S2
    • None

      Steps to Reproduce

      run the zul snippet below
      -> see messages in the console

      <zk>
          <script>
              console.log(zk.mm("2037-04-01T00:00:00-06:00").tz("America/Denver").toString());
              console.log(zk.mm("2038-04-01T00:00:00-06:00").tz("America/Denver").toString());
              console.log(zk.mm("2037-04-01T00:00:00+02:00").tz("Europe/Berlin").toString());
              console.log(zk.mm("2038-04-01T00:00:00+02:00").tz("Europe/Berlin").toString());
      
              console.log("moment.version", moment.version);
              console.log(moment("2037-04-01T00:00:00-06:00").tz("America/Denver").toString());
              console.log(moment("2038-04-01T00:00:00-06:00").tz("America/Denver").toString());
              console.log(moment("2037-04-01T00:00:00+02:00").tz("Europe/Berlin").toString());
              console.log(moment("2038-04-01T00:00:00+02:00").tz("Europe/Berlin").toString());
          </script>
      </zk>
      

      Current Result

      the daylight savings information is missing after 2038 in the current version of moment.js included in ZK, fixed in the latest version of moment.js

      Expected Result

      regularly updates of moment.js to reduce manual upgrade effort of external JS libraries

      Debug Info

      Root Cause

      https://github.com/moment/moment-timezone/issues/401

      Workaround

      replace moment.js with a newer version e.g.:

      <?script src="https://momentjs.com/downloads/moment.min.js"?>
      <?script src="https://momentjs.com/downloads/moment-timezone-with-data.min.js"?>
      <!--workaround replace zk.mm with current moment version-->
      <?script content="zk.mm=moment"?>
      

            Leon03 Leon03
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h