Skip to content

Commit

Permalink
Merge pull request #8 from raphckrman/main
Browse files Browse the repository at this point in the history
update
  • Loading branch information
raphckrman authored May 10, 2024
2 parents 89889fb + b755d26 commit 288fc40
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8,272 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm run build
- run: npm publish --access public
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_TOKEN }}
15 changes: 10 additions & 5 deletions lib/api/bookingGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ export const getBookingWeek = async (token: string, id: number, weekNumber?: num

let days = await Promise.all(terminal.jours.map(async (day) => {
let month = weekDate.getMonth();
let dayNumber = parseInt(day.dayLabel.split(" ")[1])+1;
let firstDayOfWeek = parseInt(terminal.jours[0].dayLabel.split(" ")[1]);
if (day.dayLabel) {
let dayNumber = parseInt(day.dayLabel.split(" ")[1])+1;
let firstDayOfWeek = terminal.jours[0]?.dayLabel ? parseInt(terminal.jours[0].dayLabel.split(" ")[1]) : 0;

if (firstDayOfWeek > dayNumber) {
month = month+1;
if (firstDayOfWeek > dayNumber) {
month = month+1;
}
var date = new Date(weekDate.getFullYear(), month, dayNumber);
}
else {
var date = new Date(weekDate.getFullYear(), weekDate.getMonth(), day.dayOfWeek);
}
let date = new Date(weekDate.getFullYear(), month, dayNumber);

return new BookingDay(
token,
Expand Down
2 changes: 1 addition & 1 deletion lib/interfaces/Bookings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface DayBooking {
},
autorise: boolean,
msg: string,
dayLabel: string
dayLabel?: string
}

export interface BookingPrice {
Expand Down
Loading

0 comments on commit 288fc40

Please sign in to comment.