Skip to content

feat(site): add support for weekly data on template insights #9997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve destructuring
  • Loading branch information
BrunoQuaresma committed Oct 3, 2023
commit 0fe704e205d7c08c605185a1cb0f840b84de686a
19 changes: 12 additions & 7 deletions site/src/pages/TemplatePage/TemplateInsightsPage/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@ import {
isToday as isTodayDefault,
} from "date-fns";

export function getDateRangeFilter({
startDate,
endDate,
now = new Date(),
isToday = isTodayDefault,
}: {
type GetDateRangeFilterOptions = {
startDate: Date;
endDate: Date;
// Testing purposes
now?: Date;
isToday?: (date: Date) => boolean;
}) {
};

export function getDateRangeFilter(props: GetDateRangeFilterOptions) {
const {
startDate,
endDate,
now = new Date(),
isToday = isTodayDefault,
} = props;

return {
start_time: toISOLocal(startOfDay(startDate)),
end_time: toISOLocal(
Expand Down