Skip to content

Commit

Permalink
Issue #596: Converting function to arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
KattisLej committed Sep 12, 2022
1 parent cc30451 commit 96a6671
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions frontend/src/pages/AbsencePlanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,14 @@ export const AbsencePlanner = () => {
const [tableData, setTableData] = useState<
{ startDate: Date; endDate: Date; userName: string; entryIds: number[] }[]
>([]);
const absenceFrom: Date = getAbsenceFrom();
const absenceTo: Date = getAbsenceTo();
let absenceFrom: Date;
let absenceTo: Date;
const [reloadPage, setReloadPage] = useState<boolean>(false);
const [reportedDates, setReportedDates] = useState<string[]>([]);

function getAbsenceFrom() {
let today = new Date();

return new Date(today.setMonth(today.getMonth() - 1));
}

function getAbsenceTo() {
let today = new Date();

return new Date(today.setMonth(today.getMonth() + 12));
}
let today = new Date();
absenceFrom = new Date(today.setMonth(today.getMonth() - 1));
absenceTo = new Date(today.setMonth(today.getMonth() + 12));

const timelineOptions = {
hAxis: {
Expand Down

0 comments on commit 96a6671

Please sign in to comment.