Skip to content

Commit b9abf77

Browse files
authored
fix: prevent endless loop when adding event the DST begin day (jquense#1635)
* Prevent endless loop when adding event the DST begin day * Add a comment for the reason of the change
1 parent 3fb3c49 commit b9abf77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DayColumn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class DayColumn extends React.Component {
349349

350350
while (dates.lte(current, endDate)) {
351351
slots.push(current)
352-
current = dates.add(current, this.props.step, 'minutes')
352+
current = new Date(+current + this.props.step * 60 * 1000) // using Date ensures not to create an endless loop the day DST begins
353353
}
354354

355355
notify(this.props.onSelectSlot, {

0 commit comments

Comments
 (0)