Skip to content

Commit

Permalink
Merge pull request Project-Based-Learning-IT#48 from Project-Based-Le…
Browse files Browse the repository at this point in the history
…arning-IT/Sidhant

Today's Schedule Done
  • Loading branch information
sidhant-khamankar committed Apr 12, 2021
2 parents 2d5368a + 7c9ef43 commit 0544913
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion backend/routes/doctors.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ router.route("/book-slot").post((req, res) => {
slotTime: slot.time,
doctorName: doctor.name,
doctorEmail: doctor.email,
patientName: patientName
patientName: patientName,
});

newAppointment
Expand Down
30 changes: 18 additions & 12 deletions frontend/src/Doctor/TodaysSchedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ const TodaysSchedule = () => {
}
);
// console.log(data);
console.log(date);
// console.log(date);

setAppointments(data);
console.log(Appointments);
// console.log(Appointments);

let currDate = date.getFullYear().toString();
const month = date.getMonth() + 1;
const day = date.getDate();
currDate += month < 10 ? "-0" + month.toString() : "-" + month.toString();
currDate += day < 10 ? "-0" + day.toString() : "-" + day.toString();

setAppointments((Appointments) => {
return Appointments.filter(
(Appointment) =>
Appointment.date ===
date.getFullYear().toString() +
"-" +
(date.getMonth() + 1).toString() +
"-" +
date.getDate().toString()
(Appointment) => Appointment.date === currDate
);
});
console.log(Appointments);

};

useEffect(() => {
Expand All @@ -53,11 +53,17 @@ const TodaysSchedule = () => {
</thead>
<tbody>
{Appointments.map((Appointment) => (
<tr key={Appointment._id} >
<tr key={Appointment._id}>
<th scope="row">{Appointment.date}</th>
<th scope="row">{Appointment.slotTime}</th>
<th scope="row">{Appointment.patientName}</th>
<th scope="row">Join</th>
<th scope="row">
{" "}
{/* <a href={getMeetLink(Appointment._id)} target="_blank"> */}
<a>
Join Meet
</a>
</th>
</tr>
))}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Patient/AppointmentStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const AppointmentStatus = () => {
<th scope="row">{Appointment.date}</th>
<th scope="row">{Appointment.slotTime}</th>
<th scope="row">{Appointment.doctorName}</th>
<th scope="row">Meet <a href={getMeetLink(Appointment._id)} target="_blank">Link</a></th>
<th scope="row"> <a href={getMeetLink(Appointment._id)} target="_blank">Join Meet</a></th>
</tr>
))}
</tbody>
Expand Down

0 comments on commit 0544913

Please sign in to comment.