Skip to content

Commit

Permalink
fix(timetable): make alert timeout longer
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianaCeric committed Oct 26, 2023
1 parent 915af30 commit f0516c5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/editor/util/timetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,14 @@ let alertTimeout
export function parseCellValue (timeString: string, col: TimetableColumn) {
const date = moment().startOf('day').format('YYYY-MM-DD')
const parsedDate = moment(date + 'T' + timeString, TIMETABLE_FORMATS, true)

clearTimeout(alertTimeout)

if (isTimeFormat(col.type)) {
if (!parsedDate.isValid()) {
alertTimeout = setTimeout(() => alert('Please enter a valid time format'), 500)
alertTimeout = setTimeout(() => alert('Please enter a valid time format'), 600)
return null
}

return moment(date + 'T' + timeString, TIMETABLE_FORMATS).diff(date, 'seconds')
}

return timeString
}

Expand Down

0 comments on commit f0516c5

Please sign in to comment.