Reduce cache-friendly range.
This commit is contained in:
+1
-6
@@ -3,8 +3,6 @@ import endOfHour from 'date-fns/endOfHour';
|
|||||||
import startOfDay from 'date-fns/startOfDay';
|
import startOfDay from 'date-fns/startOfDay';
|
||||||
import endOfDay from 'date-fns/endOfDay';
|
import endOfDay from 'date-fns/endOfDay';
|
||||||
import endOfMinute from 'date-fns/endOfMinute';
|
import endOfMinute from 'date-fns/endOfMinute';
|
||||||
import endOfWeek from 'date-fns/endOfWeek';
|
|
||||||
import startOfWeek from 'date-fns/startOfWeek';
|
|
||||||
import { DateRange } from './range';
|
import { DateRange } from './range';
|
||||||
|
|
||||||
export const convertRangeToCacheFriendlyTimes = (
|
export const convertRangeToCacheFriendlyTimes = (
|
||||||
@@ -20,12 +18,9 @@ export const convertRangeToCacheFriendlyTimes = (
|
|||||||
if (widthSeconds <= 60 * 60) {
|
if (widthSeconds <= 60 * 60) {
|
||||||
cacheableStart = startOfHour(range.start);
|
cacheableStart = startOfHour(range.start);
|
||||||
cacheableEnd = endOfHour(range.end);
|
cacheableEnd = endOfHour(range.end);
|
||||||
} else if (widthSeconds <= 60 * 60 * 24) {
|
} else {
|
||||||
cacheableStart = startOfDay(range.start);
|
cacheableStart = startOfDay(range.start);
|
||||||
cacheableEnd = endOfDay(range.end);
|
cacheableEnd = endOfDay(range.end);
|
||||||
} else {
|
|
||||||
cacheableStart = startOfWeek(range.start);
|
|
||||||
cacheableEnd = endOfWeek(range.end);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options?.endCap) {
|
if (options?.endCap) {
|
||||||
|
|||||||
Reference in New Issue
Block a user