Skip to content
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

236 select week #244

Merged
merged 3 commits into from
Nov 2, 2023
Merged

236 select week #244

merged 3 commits into from
Nov 2, 2023

Conversation

jonasbjoralt
Copy link
Collaborator

@jonasbjoralt jonasbjoralt commented Nov 1, 2023

Adds possibility to change active week.
Note that this does not show which week is the current one.


function handleNextWeekClick() {
if (selectedWeek) {
setSelectedWeek({ year: 2023, weekNumber: selectedWeek.weekNumber + 1 });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Denne vil vel ikke ta hensyn til årskifte? 🤔

@jonasbjoralt jonasbjoralt marked this pull request as ready for review November 1, 2023 15:05
Copy link
Contributor

@sigridge sigridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Veldig bra!

I framtiden kan vi kanskje tenke på å prefetche data for 1-2 uker rundt nåværende seleksjon, får å gjøre navigering av uker smoothere

export function stringToWeek(urlString?: string): Week | undefined {
if (!urlString) return;
try {
const args = urlString.split("-");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan du kanskje bruke destrukturering her for å gjøre koden lettere å lese? Eks:

const [yearStr, weekStr] = urlString.split("-");
  const year = Number.parseInt(yearStr);
  const week = Number.parseInt(weekStr);

@@ -0,0 +1,22 @@
import { Week } from "@/types";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Litt usikker på å plassere denne filen i data-mappen. Forstår ulempen med en utils-mappe, men jeg tenker personlig det hadde vært enklere å lokalisere denne filen i en mappe som heter utils enn en som heter data 😅 Hva tenker dere?

@jonasbjoralt jonasbjoralt merged commit 61fb6f2 into main Nov 2, 2023
3 checks passed
@jonasbjoralt jonasbjoralt deleted the 236-select-week branch November 2, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants