Renamed file containing date range and date interval utils

This commit is contained in:
Alejandro Celaya
2022-12-03 12:20:18 +01:00
parent d2ebc880a0
commit e5185f2099
22 changed files with 22 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
import { DropdownItem } from 'reactstrap';
import { FC } from 'react';
import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from './types';
import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from '../helpers/dateIntervals';
export interface DateIntervalDropdownProps {
active?: DateInterval;

View File

@@ -1,6 +1,6 @@
import { FC } from 'react';
import { DropdownBtn } from '../DropdownBtn';
import { rangeOrIntervalToString } from './types';
import { rangeOrIntervalToString } from '../helpers/dateIntervals';
import { DateIntervalDropdownItems, DateIntervalDropdownProps } from './DateIntervalDropdownItems';
export const DateIntervalSelector: FC<DateIntervalDropdownProps> = ({ onChange, active, allText }) => (

View File

@@ -1,6 +1,6 @@
import { endOfDay } from 'date-fns';
import { DateInput } from './DateInput';
import { DateRange } from './types';
import { DateRange } from '../helpers/dateIntervals';
interface DateRangeRowProps extends DateRange {
onStartDateChange: (date: Date | null) => void;

View File

@@ -9,7 +9,7 @@ import {
intervalToDateRange,
rangeIsInterval,
dateRangeIsEmpty,
} from './types';
} from '../helpers/dateIntervals';
import { DateRangeRow } from './DateRangeRow';
import { DateIntervalDropdownItems } from './DateIntervalDropdownItems';

View File

@@ -1,8 +1,6 @@
import { subDays, startOfDay, endOfDay } from 'date-fns';
import { cond, filter, isEmpty, T } from 'ramda';
import { dateOrNull, DateOrString, formatInternational, isBeforeOrEqual, parseISO } from '../../helpers/date';
// TODO Rename this to src/utils/helpers/dateIntervals.ts
import { dateOrNull, DateOrString, formatInternational, isBeforeOrEqual, parseISO } from './date';
export interface DateRange {
startDate?: Date | null;