Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Timeline wrong week number in heder

    Tested on
    Version v9.0p_2013-07-20/LGPL Development Only (2013-07-20)
    and
    SNAPSHOT_v10.0d_2014-02-27/LGPL Development Only

    Hi...

    I think there is an error in the week header title displayed in some headerLevels configurations.

    Taking a simple standalone example, if we display the timeline for the current year with week/day header levels, it works right, as first week starts at "1".
    Code:
    isc.Timeline.create({
        startDate: new Date(2014, 0, 1, 0, 0), 
        endDate: new Date(2014, 11, 31, 23, 59),
        headerLevels: [ { unit: "week" }, { unit: "day" } ]
    });
    Now if we change the header level to month/week for the same period, the first week of the year starts at "53" and second week is "2" (Week "1" is ommited)
    Code:
    isc.Timeline.create({
        startDate: new Date(2014, 0, 1, 0, 0), 
        endDate: new Date(2014, 11, 31, 23, 59),
        headerLevels: [  { unit: "month" }, { unit: "week" }]
    });
    While debugging I've noticed that the header title in that case is built with the Date.getWeek() function, which returns wrong weeks number (according to the ISO standard). Also I've noticed that there is a new undocumented Date.getWeekNumber() function (In Snapshot v10) , which works according to the ISO standard and can be used as workaround in this way:
    Code:
    isc.Timeline.create({
        startDate: new Date(2014, 0, 1, 0, 0), 
        endDate: new Date(2014, 11, 31, 23, 59),
        headerLevels: [  { unit: "month" }, 
                               { unit: "week", 
                                  titleFormatter: function(headerLevel, startDate, endDate, defaultValue, viewer){
    					return startDate.getWeekNumber()[1];
                                }}]
    });
    Best regards....
    Last edited by ipindado; 3 Mar 2014, 11:50.

    #2
    We've made a change to address - please retest with a build dated March 10 or later.

    Comment


      #3
      It works....

      Thanks...

      Best regards...

      Comment

      Working...
      X