IO-2247 Don't push manual appointments into component if they don't have a job associated.
This commit is contained in:
@@ -23,6 +23,7 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
||||
|
||||
const appt = []; // Flatten Data
|
||||
data.scheduled_in_today.forEach((item) => {
|
||||
if (item.job) {
|
||||
var i = {
|
||||
canceled: item.canceled,
|
||||
id: item.id,
|
||||
@@ -51,8 +52,11 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
||||
title: item.title,
|
||||
};
|
||||
appt.push(i);
|
||||
}
|
||||
});
|
||||
appt.sort(function (a, b) {
|
||||
return new moment(a.start) - new moment(b.start);
|
||||
});
|
||||
appt.sort ( function (a, b) { return new Date(a.start) - new Date(b.start); });
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@@ -182,7 +186,12 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<Card title={t("dashboard.titles.scheduledintoday", {date: moment().startOf("day").format("MM/DD/YYYY")})} {...cardProps}>
|
||||
<Card
|
||||
title={t("dashboard.titles.scheduledintoday", {
|
||||
date: moment().startOf("day").format("MM/DD/YYYY"),
|
||||
})}
|
||||
{...cardProps}
|
||||
>
|
||||
<div style={{ height: "100%" }}>
|
||||
<Table
|
||||
onChange={handleTableChange}
|
||||
|
||||
Reference in New Issue
Block a user