Skip to content

Commit

Permalink
Update date import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgain committed Jan 7, 2025
1 parent f690c0e commit 51997a5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ActivityCardWrapper from './card/ActivityCardWrapper'
import ActivityCardSubject from './card/ActivityCardSubject'
import ActivityCardMetadata from './card/ActivityCardMetadata'
import ActivityCardLabels from './card/ActivityCardLabels'
import { formatStartAndEndDate } from '../../../utils/date'
import { formatStartAndEndDate } from './date'

export const AVENTRI_ATTENDEE_REG_STATUSES = {
Attended: 'Attended',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from '@govuk-react/link'
import PropTypes from 'prop-types'
import styled from 'styled-components'

import { formatStartAndEndDate } from '../../../utils/date'
import { formatStartAndEndDate } from './date'
import { ACTIVITY_TYPE } from '../constants'

import CardUtils from './card/CardUtils'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'

import CardUtils from './card/CardUtils'

import { formatStartAndEndDate } from '../../../utils/date'
import { formatStartAndEndDate } from './date'
import { ACTIVITY_TYPE } from '../constants'

import ActivityCardWrapper from './card/ActivityCardWrapper'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { formatStartAndEndDate } = require('../../client/utils/date')
const { formatStartAndEndDate } = require('../date')

describe('Date tests', () => {
describe('#formatStartAndEndDate', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/client/components/ActivityFeed/activities/date.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { isAfter, parseISO, differenceInCalendarMonths } = require('date-fns')
import { isAfter, parseISO, differenceInCalendarMonths } from 'date-fns'

const {
import {
formatDate,
DATE_FORMAT_COMPACT,
DATE_FORMAT_DAY_MONTH,
} = require('./date-utils')
} from '../../../../client/utils/date-utils'

export const formatStartAndEndDate = (startDate, endDate) => {
if (startDate) {
Expand Down
3 changes: 2 additions & 1 deletion src/client/modules/Events/transformers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { compact } from 'lodash'

import urls from '../../../lib/urls'

import { getDifferenceInDays, formatStartAndEndDate } from '../../utils/date'
import { getDifferenceInDays } from '../../utils/date'
import { formatStartAndEndDate } from '../../components/ActivityFeed/activities/date'

import { TAG_COLOURS } from '../../components/Tag'
import {
Expand Down

0 comments on commit 51997a5

Please sign in to comment.