Add incermentalDate function to factories
shaharkazaz opened this issue · 0 comments
shaharkazaz commented
Description
A common use case in applications is showing an incremental date, for example, a time series chart. We proposed the following API:
General API
const dateFactory: () => Date | undefined = incermentalDate({ from, to?, step: milliseconds })
Example
const dateFactory = incermentalDate({
from: new Date('2022-06-01'),
to: new Date('2022-06-25'),
step: millisecondsInDay
});
dateFactory() // 2022-06-01
dateFactory() // 2022-06-02
dateFactory() // 2022-06-03
...
dateFactory() // 2022-06-25
dateFactory() // undefined
Proposed solution
No response
Alternatives considered
No response
Do you want to create a pull request?
No