Skip to content

Commit

Permalink
FIX: lang bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremiahUy committed Jul 1, 2024
1 parent 0f77fb2 commit 6966d6c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions apps/frontend/src/components/common/Durations.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as React from 'react'
import moment from 'moment'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faClock } from '@fortawesome/free-solid-svg-icons'
import { theme } from '../../util'
import { env } from '../../util/env'
import CustomizedStatefulTooltip from './CustomizedStatefulTooltip'
import moment from 'moment/min/moment-with-locales'

const defaultStart = moment(env.defaultStartDate)
const defaultEnd = moment('9999-12-31')
const defaultStart = moment(env.defaultStartDate).locale('nb')
const defaultEnd = moment('9999-12-31').locale('nb')
const dateFormat = 'll'

export const hasSpecifiedDate = (obj: { start?: string; end?: string }) => {
const startDate = obj.start ? moment(obj.start) : undefined
const endDate = obj.end ? moment(obj.end) : undefined
const startDate = obj.start ? moment(obj.start).locale('nb') : undefined
const endDate = obj.end ? moment(obj.end).locale('nb') : undefined
return checkDate(startDate, endDate).hasDates
}

Expand All @@ -28,13 +28,13 @@ const checkDate = (startDate?: moment.Moment, endDate?: moment.Moment, alwaysSho

export const ActiveIndicator = (props: { start?: string; end?: string; alwaysShow?: boolean; preText?: string; showDates?: boolean }) => {
const { start, end, alwaysShow, preText, showDates } = props
const startDate = start ? moment(start) : defaultStart
const endDate = end ? moment(end) : defaultEnd
const startDate = start ? moment(start).locale('nb') : defaultStart
const endDate = end ? moment(end).locale('nb') : defaultEnd
const { hasStart, hasEnd, hasDates } = checkDate(startDate, endDate, alwaysShow)
const active = startDate.isSameOrBefore(moment()) && endDate.isSameOrAfter(moment())

const startView = startDate.format(dateFormat)
const endView = endDate.format(dateFormat)
const startView = startDate.locale('nb').format(dateFormat)
const endView = endDate.locale('nb').format(dateFormat)
return hasDates ? (
<CustomizedStatefulTooltip
content={
Expand Down

0 comments on commit 6966d6c

Please sign in to comment.