Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
🚑 🐛 Fixed a major
Browse files Browse the repository at this point in the history
Fixed:
- Incorrect behavior with schedules
  • Loading branch information
kdev committed Sep 7, 2020
1 parent 010a31e commit 076046f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ const getNames = () => {

const main = (tomorrow = undefined) => {
const names = getNames(),
date = tomorrow ? new Date() : new Date(),
date = new Date(),
weekday = tomorrow ? date.setDate(date.getDate() + 1) : date,
day = tomorrow ? date.getDay() + 1 : date.getDay();

if (day >= 6 && tomorrow) return;

names.forEach(name => {
const { email, of } = getData(name),
schedule = getSchedule(name, date);
schedule = getSchedule(name, weekday);

send(email, 'Daily Schedule!', `<h3 style="color: black;">Your schedule for ${tomorrow ? 'tomorrow' : 'today'} ${toPascalCase(of)},</h3><p style="color:black;">${schedule.join('<br />')}</p>`);
});
Expand Down

1 comment on commit 076046f

@kdev
Copy link
Member Author

@kdev kdev commented on 076046f Sep 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*bug

Please sign in to comment.