mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-07-23 04:02:02 +00:00
Update fontawesome and test snapshots
This commit is contained in:
@@ -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'],
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user