Loading frontend/src/analyst/useFormatTimestamp.tsx +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ const useFormatTimestamp = () => { const { exercise } = useContext(ExerciseContext) const timeRelative = useRelativeTime() return timeRelative return timeRelative || !exercise.exerciseStart ? (timestamp: string | null) => formatTimestampRelative(timestamp, exercise.exerciseStart) : formatTimestamp Loading frontend/src/analyst/utilities.ts +2 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import { timeFormat } from 'd3-time-format' import type { SVGProps } from 'react' export const formatTimestamp = (timestamp: string | null) => { const date = new Date(timestamp || '') const date = new Date(timestamp || 0) return `${date.toISOString().substring(0, 10)} ${date.toLocaleTimeString()}` } Loading @@ -30,8 +30,7 @@ export const formatTimestampRelative = ( start: string | null ) => new Date( new Date(timestamp || '').getTime() - (start ? new Date(start).getTime() : 0) new Date(timestamp || 0).getTime() - (start ? new Date(start).getTime() : 0) ) .toISOString() .substring(11, 19) Loading Loading
frontend/src/analyst/useFormatTimestamp.tsx +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ const useFormatTimestamp = () => { const { exercise } = useContext(ExerciseContext) const timeRelative = useRelativeTime() return timeRelative return timeRelative || !exercise.exerciseStart ? (timestamp: string | null) => formatTimestampRelative(timestamp, exercise.exerciseStart) : formatTimestamp Loading
frontend/src/analyst/utilities.ts +2 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import { timeFormat } from 'd3-time-format' import type { SVGProps } from 'react' export const formatTimestamp = (timestamp: string | null) => { const date = new Date(timestamp || '') const date = new Date(timestamp || 0) return `${date.toISOString().substring(0, 10)} ${date.toLocaleTimeString()}` } Loading @@ -30,8 +30,7 @@ export const formatTimestampRelative = ( start: string | null ) => new Date( new Date(timestamp || '').getTime() - (start ? new Date(start).getTime() : 0) new Date(timestamp || 0).getTime() - (start ? new Date(start).getTime() : 0) ) .toISOString() .substring(11, 19) Loading