File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/views/EmergencySurge/SurgeTable Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -95,12 +95,17 @@ export default function SurgeTable(props: Props) {
9595 'duration' ,
9696 strings . surgeAlertDuration ,
9797 ( item ) => {
98- if ( isNotDefined ( item . created_at ) || isNotDefined ( item . end ) ) {
98+ if ( isNotDefined ( item . start ) || isNotDefined ( item . end ) ) {
9999 return undefined ;
100100 }
101101
102- const alertDate = new Date ( item . created_at ) ;
102+ const alertDate = new Date ( item . start ) ;
103103 const deadline = new Date ( item . end ) ;
104+
105+ if ( alertDate > deadline ) {
106+ return undefined ;
107+ }
108+
104109 const duration = getDuration ( alertDate , deadline ) ;
105110
106111 return duration ;
@@ -117,11 +122,11 @@ export default function SurgeTable(props: Props) {
117122 const startDate = new Date ( item . start ) ;
118123 const nowMs = new Date ( ) . getTime ( ) ;
119124
120- const duration = startDate . getTime ( ) < nowMs
125+ const start = startDate . getTime ( ) < nowMs
121126 ? strings . emergencySurgeImmediately
122127 : startDate . toLocaleString ( ) ;
123128
124- return duration ;
129+ return start ;
125130 } ,
126131 ) ,
127132 createStringColumn < SurgeListItem , number > (
You can’t perform that action at this time.
0 commit comments