From cba99adc2a0bd43f6188abe9bd49aab1f31cbb86 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Mon, 7 Jul 2025 18:58:06 -0400 Subject: [PATCH] Fix date filter using month filter when year is all time and add background to stats section --- src/ui/code-blocks/ReadingStatsCodeBlockView.svelte | 3 ++- src/ui/stores/date-filter.svelte.ts | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/code-blocks/ReadingStatsCodeBlockView.svelte b/src/ui/code-blocks/ReadingStatsCodeBlockView.svelte index 92c00c1..19eaa73 100644 --- a/src/ui/code-blocks/ReadingStatsCodeBlockView.svelte +++ b/src/ui/code-blocks/ReadingStatsCodeBlockView.svelte @@ -167,12 +167,13 @@ .obt-reading-stats { display: flex; flex-direction: column; - gap: 1rem; + gap: var(--size-4-6); max-width: 50rem; margin: 0 auto; .section { padding: 0.5rem; + background-color: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: 0.5rem; diff --git a/src/ui/stores/date-filter.svelte.ts b/src/ui/stores/date-filter.svelte.ts index cfaa74e..51cd0da 100644 --- a/src/ui/stores/date-filter.svelte.ts +++ b/src/ui/stores/date-filter.svelte.ts @@ -29,11 +29,11 @@ export function createDateFilter( if (date.year() !== filterYear) { return false; } - } - if (filterMonth !== ALL_TIME) { - if (date.month() !== filterMonth - 1) { - return false; + if (filterMonth !== ALL_TIME) { + if (date.month() !== filterMonth - 1) { + return false; + } } } return true;