Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-40501

Viewxls macro wrongly calculates the first week number of each year with the Excel WEEKNUM() function

    XMLWordPrintable

Details

    Description

      Bug description

      According to Excel documentation: https://support.office.com/en-us/article/WEEKNUM-function-e5c43a03-b4ab-426c-b411-b18c13c75340

      The WEEKNUM() function in Excel will calculate the number of the week based on a provided date.

      • Jan 1 is always Week 1
      • The first Sunday encountered after Jan 1 is the beginning of Week 2

      The bug is that the ViewXLS macro will erroneously calculate the days of the year before the first Saturday as Week 2.

      Steps to reproduce

      1. Download the attached example file: weeknumbers.xlsx
      2. Upload to Confluence (I tested in Confluence 5.8.18)
      3. Insert a ViewXLS macro (display name is "Excel Macro") to the page referencing the attachment
      4. Note the discrepancies in the first few days of each year.

      For example, Jan 7 2017 is the first Saturday of 2017. Jan 1 through Jan 6 should all be Week 1, but ViewXLS will show Week 2.

      Workarounds

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rchang Robert Chang
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: