luxon icon indicating copy to clipboard operation
luxon copied to clipboard

Interval.splitBy for seconds

Open RubayloDev opened this issue 1 year ago • 1 comments

Interval.fromDateTimes(day.set({ day: firstDay, 'hour': 0, 'minute':0 }), day.set({ day: firstDay, 'hour': 2, 'minute':0, 'seconds':30 })).splitBy('hour') return 2 elements

Interval.fromDateTimes(day.set({ day: firstDay, 'hour': 0, 'minute':0 }), day.set({ day: firstDay, 'hour': 2, 'minute':1, 'seconds':0 })).splitBy('hour') return 3 elements

Expected result. 3 elements in both cases

RubayloDev avatar Dec 29 '23 15:12 RubayloDev

The code you have posted doesn't actually work, splitBy expects a Duration, not a string. Please also post the values for day and firstDay as well as your time zone. I suspect you are observing the effects of DST.

diesieben07 avatar Dec 29 '23 15:12 diesieben07