Two digit year entry has bug in Wijmo Version 5.20172.334

Posted by: jay.ferguson on 26 October 2017, 7:59 pm EST

    • Post Options:
    • Link

    Posted 26 October 2017, 7:59 pm EST

    Hi we updated to version 5.20172.334 a couple weeks ago and we found a bug when entering a 2 digit year into a data control that converts to a 4 digit year. We just fixed the bug in wijmo.js for now but would like you to confirm it is a bug.

    The change is in wijmo.js function Globalize.parseDate = function (value, format)

    The current version is:

     
                else if (year < 100 && hasFullYear) {
                    var max = wijmo.isNumber(cal.twoDigitYearMax) ? cal.twoDigitYearMax : 2029;
                    year += (year + 2000 < max) ? 2000 : 1900;
                }
    

    We changed it to this:

     
                else if (year < 100 && !hasFullYear) {
                    var max = wijmo.isNumber(cal.twoDigitYearMax) ? cal.twoDigitYearMax : 2029;
                    year += (year + 2000 < max) ? 2000 : 1900;
                }
    

    hasFullYear is true for our configuration so we believe the logic is wrong in the current version. This was preventing 2 digit years from converting correctly.

    If I don’t hear back on this topic I’ll submit a support ticket.

    regards,

    Jay Ferguson

    Sr Dev .NET\JS\Angular\TS

  • Posted 26 October 2017, 8:03 pm EST

    Hi again reverse that

    current code has

      else if (year < 100 && !hasFullYear) {
                    var max = wijmo.isNumber(cal.twoDigitYearMax) ? cal.twoDigitYearMax : 2029;
                    year += (year + 2000 < max) ? 2000 : 1900;
                }
    

    We changed it to

      else if (year < 100 && hasFullYear) {
                    var max = wijmo.isNumber(cal.twoDigitYearMax) ? cal.twoDigitYearMax : 2029;
                    year += (year + 2000 < max) ? 2000 : 1900;
                }
    

    to fix the problem.

    Jay

  • Posted 27 October 2017, 7:19 am EST

    Hello Jay,

    This issue has been found fixed in the latest maintenance build 5.20172.359 which can be downloaded from My Licenses page if licenses key is registered.

    Please refer to the fiddle for the same.

    http://jsfiddle.net/Wijmo5/bj0wbdfd/?utm_source=website&utm_medium=embed&utm_campaign=bj0wbdfd

    ~Manish

  • Posted 27 October 2017, 1:10 pm EST

    Ok ty Manish.

    Jay

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels