Moved date-time related utils to the proper folder

This commit is contained in:
Alejandro Celaya 2022-10-23 10:49:35 +02:00
parent c3b60367f3
commit 6df12ce194
10 changed files with 13 additions and 13 deletions

View file

@ -7,7 +7,7 @@ import { Tag } from '../../tags/helpers/Tag';
import { SelectedServer } from '../../servers/data';
import { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon';
import { ShortUrl } from '../data';
import { Time } from '../../utils/Time';
import { Time } from '../../utils/dates/Time';
import { ShortUrlVisitsCount } from './ShortUrlVisitsCount';
import { ShortUrlsRowMenuProps } from './ShortUrlsRowMenu';
import './ShortUrlsRow.scss';

View file

@ -1,5 +1,5 @@
@import './mixins/vertical-align';
@import './base';
@import '../mixins/vertical-align';
@import '../base';
.date-input-container {
position: relative;

View file

@ -4,7 +4,7 @@ import DatePicker, { ReactDatePickerProps } from 'react-datepicker';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCalendarAlt as calendarIcon } from '@fortawesome/free-regular-svg-icons';
import classNames from 'classnames';
import { STANDARD_DATE_FORMAT } from './helpers/date';
import { STANDARD_DATE_FORMAT } from '../helpers/date';
import './DateInput.scss';
export type DateInputProps = ReactDatePickerProps;

View file

@ -1,5 +1,5 @@
import { endOfDay } from 'date-fns';
import { DateInput } from '../DateInput';
import { DateInput } from './DateInput';
import { DateRange } from './types';
interface DateRangeRowProps extends DateRange {

View file

@ -1,6 +1,6 @@
import { ReactDatePickerProps } from 'react-datepicker';
import { FC } from 'react';
import { DateInput } from '../DateInput';
import { DateInput } from './DateInput';
import { STANDARD_DATE_AND_TIME_FORMAT } from '../helpers/date';
export type DateTimeInputProps = Omit<ReactDatePickerProps, 'showTimeSelect' | 'dateFormat' | 'timeIntervals'>;

View file

@ -1,5 +1,5 @@
import { parseISO, format as formatDate, getUnixTime, formatDistance } from 'date-fns';
import { isDateObject, STANDARD_DATE_AND_TIME_FORMAT } from './helpers/date';
import { isDateObject, STANDARD_DATE_AND_TIME_FORMAT } from '../helpers/date';
export interface TimeProps {
date: Date | string;

View file

@ -1,7 +1,7 @@
import { UncontrolledTooltip } from 'reactstrap';
import { ExternalLink } from 'react-external-link';
import { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail';
import { Time } from '../utils/Time';
import { Time } from '../utils/dates/Time';
import { ShortUrlVisits } from './reducers/shortUrlVisits';
import { VisitsHeader } from './VisitsHeader';
import './ShortUrlVisitsHeader.scss';

View file

@ -10,7 +10,7 @@ import { determineOrderDir, Order, sortList } from '../utils/helpers/ordering';
import { prettify } from '../utils/helpers/numbers';
import { supportsBotVisits } from '../utils/helpers/features';
import { SelectedServer } from '../servers/data';
import { Time } from '../utils/Time';
import { Time } from '../utils/dates/Time';
import { TableOrderIcon } from '../utils/table/TableOrderIcon';
import { MediaMatcher } from '../utils/types';
import { NormalizedOrphanVisit, NormalizedVisit } from './types';

View file

@ -1,8 +1,8 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { parseISO } from 'date-fns';
import { DateInput, DateInputProps } from '../../src/utils/DateInput';
import { renderWithEvents } from '../__helpers__/setUpTest';
import { DateInput, DateInputProps } from '../../../src/utils/dates/DateInput';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<DateInput />', () => {
const setUp = (props: Partial<DateInputProps> = {}) => renderWithEvents(

View file

@ -1,6 +1,6 @@
import { render } from '@testing-library/react';
import { TimeProps, Time } from '../../src/utils/Time';
import { parseDate } from '../../src/utils/helpers/date';
import { TimeProps, Time } from '../../../src/utils/dates/Time';
import { parseDate } from '../../../src/utils/helpers/date';
describe('<Time />', () => {
const setUp = (props: TimeProps) => render(<Time {...props} />);