We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 774f8f1 commit b867eafCopy full SHA for b867eaf
src/Shared/Helpers.tsx
@@ -790,7 +790,14 @@ export const getTimeDifference = ({
790
return fallbackString
791
}
792
793
- const duration = moment.duration(moment(endTime).diff(moment(startTime)))
+ const start = moment(startTime)
794
+ const end = moment(endTime)
795
+ if (!start.isValid() || !end.isValid()) {
796
+ return fallbackString
797
+ }
798
+
799
+ const diff = Math.abs(end.diff(start))
800
+ const duration = moment.duration(diff)
801
802
const units = [
803
{ label: 'd', value: duration.days() },
0 commit comments