feat(ui): improve mobile responsive layouts
This commit is contained in:
Vendored
+14
@@ -65,6 +65,20 @@ export function getNormalizedDateRange(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate a rolling date range ending at the current moment.
|
||||
* Example: 1 day means the last 24 hours, not yesterday 00:00 to today 23:59.
|
||||
*/
|
||||
export function getRollingDateRange(
|
||||
days: number,
|
||||
fromDate: Date = new Date()
|
||||
): { start: Date; end: Date } {
|
||||
const end = new Date(fromDate)
|
||||
const start = new Date(end.getTime() - days * 24 * 60 * 60 * 1000)
|
||||
|
||||
return { start, end }
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute time range as Unix timestamps (seconds)
|
||||
* @param days Default number of days if no dates provided
|
||||
|
||||
Reference in New Issue
Block a user