#820 guard handleRepeatToggle against an invalid start
This commit is contained in:
committed by
Benoit TELLIER
parent
00286b88ea
commit
7f78f70808
@@ -66,7 +66,8 @@ const DateTimeControlsRow: React.FC<DateTimeControlsRowProps> = ({
|
||||
setShowRepeat(newShowRepeat)
|
||||
if (newShowRepeat) {
|
||||
const days = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']
|
||||
const eventStartDate = new Date(start)
|
||||
const parsed = new Date(start)
|
||||
const eventStartDate = isNaN(parsed.getTime()) ? new Date() : parsed
|
||||
const jsDay = eventStartDate.getDay()
|
||||
const icsDay = days[(jsDay + 6) % 7]
|
||||
setRepetition({
|
||||
|
||||
Reference in New Issue
Block a user