Skip to content

Commit

Permalink
Update NavBar.svelte (#50)
Browse files Browse the repository at this point in the history
When `monthSelectorOpen === true` user already has a convenient way to select month, what isn't true about year selecting. This might help.
  • Loading branch information
multipliedtwice authored Aug 23, 2023
1 parent 528e5f0 commit 27e0d46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/view/date-view/NavBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
highlighted.set($displayedDate)
}
function incrementMonth (direction) {
function increment(direction, entity) {

Check failure on line 43 in src/components/view/date-view/NavBar.svelte

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 0 spaces but found 1

Check failure on line 43 in src/components/view/date-view/NavBar.svelte

View workflow job for this annotation

GitHub Actions / build

Missing space before function parentheses
if (direction === 1 && !canIncrementMonth) return
if (direction === -1 && !canDecrementMonth) return
displayedDate.update(d => d.add(direction, 'months'))
displayedDate.update((d) => d.add(direction, entity))
highlighted.set($displayedDate)
}
Expand All @@ -66,7 +66,7 @@
type="button"
aria-label="Previous month"
disabled={!canDecrementMonth}
on:click={() => incrementMonth(-1)}>
on:click={() => increment(-1, monthSelectorOpen ? "year" : "month")}>

Check failure on line 69 in src/components/view/date-view/NavBar.svelte

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 69 in src/components/view/date-view/NavBar.svelte

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
<i class="arrow left"></i>
</button>
<button type="button" class="label" on:click={toggleMonthSelectorOpen}>
Expand All @@ -76,7 +76,7 @@
type="button"
aria-label="Next month"
disabled={!canIncrementMonth}
on:click={() => incrementMonth(1)}>
on:click={() => increment(1, monthSelectorOpen ? "year" : "month")}>

Check failure on line 79 in src/components/view/date-view/NavBar.svelte

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 79 in src/components/view/date-view/NavBar.svelte

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
<i class="arrow right"></i>
</button>
</div>
Expand Down

0 comments on commit 27e0d46

Please sign in to comment.