BOD-84 Load calculates for this week. Bug exists going past current week.

This commit is contained in:
Patrick Fic
2020-05-08 17:25:42 -07:00
parent 6096fce7a6
commit 0c93488c1f
9 changed files with 139 additions and 70 deletions

View File

@@ -31,7 +31,7 @@ export function ScheduleCalendarContainer({ calculateScheduleLoad }) {
);
if (loading) return <LoadingSpinner />;
if (error) return <AlertComponent message={error.message} type="error" />;
if (error) return <AlertComponent message={error.message} type='error' />;
let normalizedData = data.appointments.map((e) => {
//Required becuase Hasura returns a string instead of a date object.
return Object.assign(
@@ -42,29 +42,13 @@ export function ScheduleCalendarContainer({ calculateScheduleLoad }) {
);
});
console.log("ScheduleCalendarContainer -> normalizedData", normalizedData);
normalizedData.push({
id: 1,
title: "All day event",
allDay: true,
isintake: false,
start: new Date(),
end: new Date(),
});
calculateScheduleLoad(range.end);
return (
<span>
<button
onClick={() => {
calculateScheduleLoad(range.end);
}}
>
Calc Load
</button>
<ScheduleCalendarComponent
refetch={refetch}
data={data ? normalizedData : null}
/>
</span>
<ScheduleCalendarComponent
refetch={refetch}
data={data ? normalizedData : null}
/>
);
}
export default connect(