MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / getFilterDateRange

Method getFilterDateRange

src/views/StatsView.ts:1016–1048  ·  view source on GitHub ↗

* Get date range based on current filters

()

Source from the content-addressed store, hash-verified

1014 * Get date range based on current filters
1015 */
1016 private getFilterDateRange(): { start?: Date; end?: Date } {
1017 const todayLocal = getTodayLocal();
1018
1019 switch (this.currentFilters.dateRange) {
1020 case "7days":
1021 return {
1022 start: startOfDay(subDays(todayLocal, 7)),
1023 end: endOfDay(todayLocal),
1024 };
1025 case "30days":
1026 return {
1027 start: startOfDay(subDays(todayLocal, 30)),
1028 end: endOfDay(todayLocal),
1029 };
1030 case "90days":
1031 return {
1032 start: startOfDay(subDays(todayLocal, 90)),
1033 end: endOfDay(todayLocal),
1034 };
1035 case "custom":
1036 return {
1037 start: this.currentFilters.customStartDate
1038 ? new Date(`${this.currentFilters.customStartDate}T00:00:00`)
1039 : undefined,
1040 end: this.currentFilters.customEndDate
1041 ? new Date(`${this.currentFilters.customEndDate}T23:59:59.999`)
1042 : undefined,
1043 };
1044 case "all":
1045 default:
1046 return {};
1047 }
1048 }
1049
1050 private renderOverviewStats(container: HTMLElement, stats: OverallStats) {
1051 container.empty();

Callers 1

applyTaskFiltersMethod · 0.95

Calls 1

getTodayLocalFunction · 0.90

Tested by

no test coverage detected