-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaa75dd
commit 61fb6f2
Showing
13 changed files
with
171 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Core.DomainModels; | ||
|
||
public record Week(int Year, int WeekNumber); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"use client"; | ||
import { useFilteredConsultants } from "@/hooks/useFilteredConsultants"; | ||
import SecondaryButton from "@/components/SecondaryButton"; | ||
|
||
export default function WeekSelection() { | ||
const { incrementSelectedWeek, resetSelectedWeek, decrementSelectedWeek } = | ||
useFilteredConsultants(); | ||
|
||
return ( | ||
<div className="flex flex-row gap-1"> | ||
<SecondaryButton label={"<"} onClick={decrementSelectedWeek} /> | ||
<SecondaryButton label={"Denne uka"} onClick={resetSelectedWeek} /> | ||
<SecondaryButton label={">"} onClick={incrementSelectedWeek} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Week } from "@/types"; | ||
|
||
export function stringToWeek(urlString?: string): Week | undefined { | ||
if (!urlString) return; | ||
try { | ||
const args = urlString.split("-"); | ||
const year = Number.parseInt(args[0]); | ||
const week = Number.parseInt(args[1]); | ||
if (year && week) { | ||
return { | ||
year: year, | ||
weekNumber: week, | ||
}; | ||
} | ||
} catch { | ||
return; | ||
} | ||
} | ||
|
||
export function weekToString(week: Week) { | ||
return `${week.year}-${week.weekNumber}`; | ||
} |
Oops, something went wrong.