mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 21:03:29 +00:00
bugfix duration
duration would be invalid when timestart > timeend
This commit is contained in:
@@ -16,6 +16,12 @@ const ExpandedBlock = (props) => {
|
||||
|
||||
const oscid = data.id.length > 4 ? '...' : data.id;
|
||||
|
||||
// if end is before, assume is the day after
|
||||
const duration =
|
||||
data.timeStart > data.timeEnd
|
||||
? data.timeEnd + 86400000 - data.timeStart
|
||||
: data.timeEnd + 86400000 - data.timeStart;
|
||||
|
||||
return (
|
||||
<>
|
||||
<span className={style.drag} {...provided.dragHandleProps}>
|
||||
@@ -33,6 +39,7 @@ const ExpandedBlock = (props) => {
|
||||
actionHandler={actionHandler}
|
||||
timeStart={data.timeStart}
|
||||
timeEnd={data.timeEnd}
|
||||
duration={duration}
|
||||
delay={delay}
|
||||
className={style.time}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user