Skip to content

Commit

Permalink
formatting (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbjoralt authored Oct 15, 2024
1 parent 406bac7 commit b51e139
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
14 changes: 14 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

# Useful commands

Run:

```bash
yarn dev
```

Autofix formatting:

```bash
yarn prettier
```

## Getting Started

First, run the development server:
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"start": "next start",
"lint": "next lint",
"prettier:ci": "prettier --check . ",
"prettier": "prettier --write . ",
"generate-types": "npx swagger-typescript-api -p http://localhost:7172/swagger/v0/swagger.json -o ./src -n api-types.ts --no-client"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/hooks/staffing/useSelectedWeek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export function useSelectedWeek() {
})
: DateTime.now();

const newDate = date.plus({ week: numberOfWeeks }).plus({day: 4});
const newDate = date.plus({ week: numberOfWeeks }).plus({ day: 4 });

updateFilters({
week: { year: newDate.year, weekNumber: newDate.weekNumber },
});
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/hooks/useWeekSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ export function useWeekSelectors() {
);
}, [selectedWeek, selectedWeekSpan]);

function changeSelectedWeek(numberOfWeeks: number) {
function changeSelectedWeek(numberOfWeeks: number) {
const date = selectedWeek
? DateTime.now().set({
weekYear: selectedWeek.year,
weekNumber: selectedWeek.weekNumber,
})
: DateTime.now();

const newDate = date.plus({ week: numberOfWeeks }).plus({day:4});
const newDate = date.plus({ week: numberOfWeeks }).plus({ day: 4 });

setSelectedWeek({ year: newDate.year, weekNumber: newDate.weekNumber });
}

Expand Down

0 comments on commit b51e139

Please sign in to comment.