[Bug]: DAYS360 (US method) ignores the end-of-month rule when the start date is the last day of February
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
DateTimeHelper.ts、特に issue で2月と月末のチェック順序が示されている toBasisUS から始めてください。提供された3つの DAYS360 の例を実行し、結果を期待値と比較してください。最初の2つがそれぞれ300と30を返し、3つ目が引き続き60を返せば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
With the default US (NASD) method, when the start date is the last day of February it becomes the 30th, and then an end date on the 31st also becomes the 30th (Excel DAYS360 documentation). HyperFormula applies the February adjustment after the start.day === 30 && end.day === 31 check, so the end date is not adjusted and the result is one day too large.
const { HyperFormula } = require('hyperformula')
const hf = HyperFormula.buildFromArray([[
'=DAYS360(DATE(2024,2,29), DATE(2024,12,31))',
'=DAYS360(DATE(2023,2,28), DATE(2023,3,31))',
'=DAYS360(DATE(2024,1,30), DATE(2024,3,31))',
]], { licenseKey: 'gpl-v3' })
console.log(hf.getSheetValues(0)[0])
Actual: [ 301, 31, 60 ]
Expected (Excel, LibreOffice): [ 300, 30, 60 ]
The third call (start already on the 30th) returns 60, which shows the end-of-month rule works when the start date did not need the February adjustment.
Cause: DateTimeHelper.toBasisUS in DateTimeHelper.ts checks start.day === 30 && end.day === 31 before setting start.day = 30 for the last day of February.
Video or screenshots
N/A
Demo
https://gist.github.com/trackoor/956d3d7fa69b41acdf9f9bd48071b52e
HyperFormula version
3.5.0 (npm), also master (187dfa16) and develop (5a6eb09)
Your framework
None (Node.js)
Your environment
Node.js v26.13.0 on Linux
Credit: https://ucsbplse.github.io/
- 主要言語
- TypeScript
- スター
- 2.8k
- フォーク
- 175
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
handsontable/hyperformula のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
handsontable/hyperformula#1803 ·
メンテナーはふだん 1 日以内に返信
-
numberToSimpleDate returns day 0 for 31 December of some years when leapYear1900 is true対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
handsontable/hyperformula#1793 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
handsontable/hyperformula#1745 ·
メンテナーはふだん 1 日以内に返信
-
Bug Impact: Low
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
handsontable/hyperformula#1641 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
handsontable/hyperformula#1878 ·
メンテナーはふだん 1 日以内に返信
handsontable/hyperformula の issue をすべて見る
似ている issue
-
area:frontend kind:bug priority:p2 ready
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
RunestoneInteractive/rs#1661 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
capricorn86/happy-dom#2594 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ehmpathy/rhachet-roles-ehmpathy#1294 ·
メンテナーはふだん 1 日以内に返信