Skip to content

Commit

Permalink
fix: prevent endless loop when adding event the DST begin day (jquens…
Browse files Browse the repository at this point in the history
…e#1635)

* Prevent endless loop when adding event the DST begin day

* Add a comment for the reason of the change
  • Loading branch information
jeanlazarou authored Apr 20, 2020
1 parent 3fb3c49 commit b9abf77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class DayColumn extends React.Component {

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

notify(this.props.onSelectSlot, {
Expand Down

0 comments on commit b9abf77

Please sign in to comment.