From 815dba0db99a2306aba5ffdb69a70a5c50598ecb Mon Sep 17 00:00:00 2001 From: Jean Lazarou Date: Sat, 11 Apr 2020 17:04:43 +0200 Subject: [PATCH 1/2] Prevent endless loop when adding event the DST begin day --- src/DayColumn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DayColumn.js b/src/DayColumn.js index 8474a0eda1..0b827c4bb7 100644 --- a/src/DayColumn.js +++ b/src/DayColumn.js @@ -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) } notify(this.props.onSelectSlot, { From 0a8717ffbef9d5dc55f356443f822cc8e787d544 Mon Sep 17 00:00:00 2001 From: Jean Lazarou Date: Fri, 17 Apr 2020 23:00:22 +0200 Subject: [PATCH 2/2] Add a comment for the reason of the change --- src/DayColumn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DayColumn.js b/src/DayColumn.js index 0b827c4bb7..71331ca129 100644 --- a/src/DayColumn.js +++ b/src/DayColumn.js @@ -349,7 +349,7 @@ class DayColumn extends React.Component { while (dates.lte(current, endDate)) { slots.push(current) - current = new Date(+current + this.props.step * 60 * 1000) + 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, {