Open sarbogast opened 5 years ago
Hi @sarbogast, thanks for raising this issue! It does appear to be a bug. I'll get on this shortly 😀
I still experience the same problem, but I managed to solve it.
Instead of:
const openRange = moment.range(start, null)
I used:
const openRange = moment.range(start, moment())
In my case logically it had the same effect.
When creating open-ended ranges, the problem still persists, it appears that pull-request #273 was intended to solve it, but it was eventually reverted.
Regarding @francescobilotta's answer, using const openRange = moment.range(start, moment())
would create a range from the provided start date up to the current date, rather than an open range. I managed to create an open range with const openRange = moment.range(start)
although I had to ignore the TypeScript error.
I'm trying to create open-ended ranges in a TypeScript class, but
moment.range()
seems to only accept Dates or Moments as inputs, not null or undefined.Those 2 lines fail: