Skip to content

[Bug]: ISOWEEKNUM() returns 53 for late-December days that belong to week 1 of the next year #1882

Open

Description

@jayhemnani9910

Description

=ISOWEEKNUM(DATE(2024,12,30)) returns 53. 30 December 2024 is a Monday and starts ISO week 1 of 2025, so Excel, Google Sheets and LibreOffice return 1. 2024 has only 52 ISO weeks. The same happens for 31 December 2024, for 29 to 31 December 2025, and in other years where the last days of December fall in the new year's first week.

Dates at the start of January that belong to the previous year's last week are already handled (ISOWEEKNUM(DATE(2021,1,1)) = 53 is correct). isoweeknumCore in DateTimePlugin.ts (develop 5a6eb09) recurses when the result is 0, but never checks whether a late-December date falls on or after the first Monday of next year's week 1.

This shows up in weekly reports around New Year: the last days of December get counted as week 53 of a year that doesn't have one.

Video or screenshots

No response

Demo

const hf = HyperFormula.buildFromArray([['=ISOWEEKNUM(DATE(2024,12,30))']], { licenseKey: 'gpl-v3' })
hf.getCellValue({ sheet: 0, row: 0, col: 0 }) // 53, expected 1

HyperFormula version

3.5.0

Your framework

None (plain Node.js)

Your environment

Node.js 24, Linux x64

Activity

  1. jayhemnani9910 commented on Nov 29, 2026

    @jayhemnani9910
    Author

    @sequba friendly ping on this and #1881. Are these worth keeping open, or should I close them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions