Update fontawesome and test snapshots

This commit is contained in:
Alejandro Celaya
2023-08-08 12:43:09 +02:00
parent 5bce7b91f1
commit f420c7f767
12 changed files with 191 additions and 147 deletions

View File

@@ -85,7 +85,7 @@ export const intervalToDateRange = cond<[DateInterval | undefined], DateRange>([
export const dateToMatchingInterval = (date: DateOrString): DateInterval => {
const theDate = parseISO(date);
return cond<never, DateInterval>([
return cond<never[], DateInterval>([
[() => isBeforeOrEqual(startOfDay(now()), theDate), () => 'today'],
[() => isBeforeOrEqual(startOfDaysAgo(1), theDate), () => 'yesterday'],
[() => isBeforeOrEqual(startOfDaysAgo(7), theDate), () => 'last7Days'],

View File

@@ -84,7 +84,7 @@ const STEP_TO_DATE_FORMAT: Record<Step, (date: Date) => string> = {
const determineInitialStep = (oldestVisitDate: string): Step => {
const now = new Date();
const oldestDate = parseISO(oldestVisitDate);
const matcher = cond<never, Step | undefined>([
const matcher = cond([
[() => differenceInDays(now, oldestDate) <= 2, always<Step>('hourly')], // Less than 2 days
[() => differenceInMonths(now, oldestDate) <= 1, always<Step>('daily')], // Between 2 days and 1 month
[() => differenceInMonths(now, oldestDate) <= 6, always<Step>('weekly')], // Between 1 and 6 months