numberToSimpleDate returns day 0 for 31 December of some years when leapYear1900 is true
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Locate the numberToSimpleDate function in the HyperFormula codebase. The bug is in the year check where it compares against {year: year - 1, …} instead of {year, …}. Fix that comparison, then run the date, EDATE, EOMONTH and DAY specs to verify the fix resolves the 32 affected years without breaking existing behavior.
Written by the indexing model from the issue text.
Description
With leapYear1900: true, numberToSimpleDate decomposes 31 December of 32 years between 1900 and 2200 (for example 2036 and 2040) as day 0 of January of the next year. =EOMONTH(DATE(2036,12,31),0) returns 31 January 2037, and TEXT of that serial shows 2037-01-00. It happens with and without nullDate 1899-12-31.
The year check in that function compares against {year: year - 1, …} where {year, …} looks intended. Changing it brings the 32 affected years to 0 in both leap configurations, leaves the default configuration unchanged, and the 80 date, EDATE, EOMONTH and DAY specs I ran still pass.
Found while reviewing #1781. That PR doesn't cause it.
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 175
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from handsontable/hyperformula
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
handsontable/hyperformula#1879 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
handsontable/hyperformula#1803 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
handsontable/hyperformula#1745 ·
Maintainers usually reply within 1 day
-
Bug Impact: Low
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
handsontable/hyperformula#1641 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 3/5 1-2 days Newbie friendliness 74/100
handsontable/hyperformula#1878 ·
Maintainers usually reply within 1 day
All issues in handsontable/hyperformula
Similar issues
-
area:frontend kind:bug priority:p2 ready
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
RunestoneInteractive/rs#1661 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
capricorn86/happy-dom#2594 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ehmpathy/rhachet-roles-ehmpathy#1294 ·
Maintainers usually reply within 1 day