danfojs icon indicating copy to clipboard operation
danfojs copied to clipboard

dateRange not working as expected for hourly frequency

Open Kyervnienh opened this issue 2 years ago • 2 comments

Describe the bug I wanna use dateRange to get an array of dates for every hour between "start" and "end", but instead i'm getting an array of date s only between the initial and final hour without considering the days/months/years between the dates.

If freq = "D" it has the expected behavior.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/danfo-js-sandbox-forked-1tg1km?file=/src/App.js
  2. Click on the button "test dateRange"
  3. In the console there will be three arrays, the first with one element and the second with 10, both of them with freq="H" and the wrong behavior, the third array has the correct behavior when using freq="D"

Expected behavior When using freq="H" and providing <> and <> the output should be an array with every hour between the two dates.

Screenshots Inputs

Outputs

Desktop (please complete the following information):

  • OS: [MacOS Ventura]
  • Browser [chrome]
  • Version [1.1.2]

Kyervnienh avatar May 03 '23 21:05 Kyervnienh

Found a similar problem. Probably related.

dateRange({ start: "2004-07-30", end: "2023-09-29", freq: "D" }); results in

image

The dates between 2023-08-29 and 2023-09-28 are missing.

jackchalat avatar Sep 30 '23 08:09 jackchalat