Skip to content

Commit

Permalink
deal with undefined number of vacation days initially
Browse files Browse the repository at this point in the history
  • Loading branch information
limbero committed Mar 11, 2024
1 parent 14e2445 commit 6ce333c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ function App() {
}

function getDaysForTwelveMonthSpan(days) {
console.log(days);
let start = 0;
let startSet = false;
let stop = days.length;
Expand Down Expand Up @@ -183,8 +184,8 @@ function App() {
}

function numVacationDaysLeft(from = numVacationDays?.[activeYear]?.[location]) {
const twelveMonthVacationDays = getDaysForTwelveMonthSpan(vacationDays?.[location]);
const twelveMonthWorkedHolidays = getDaysForTwelveMonthSpan(workedHolidays?.[location]);
const twelveMonthVacationDays = getDaysForTwelveMonthSpan(vacationDays?.[location] || []);
const twelveMonthWorkedHolidays = getDaysForTwelveMonthSpan(workedHolidays?.[location] || []);

return (
from -
Expand Down

0 comments on commit 6ce333c

Please sign in to comment.