Skip to content

Instantly share code, notes, and snippets.

@RusseII
Last active June 1, 2020 13:41
Show Gist options
  • Save RusseII/aa3f44884cc71c3859990360fc28755d to your computer and use it in GitHub Desktop.
Save RusseII/aa3f44884cc71c3859990360fc28755d to your computer and use it in GitHub Desktop.
// this is the only variable you should edit, pick the times you would like to work. 7 = 7am, 13 = 1pm
const times = [7, 8, 9, 11, 12, 13, 15, 16, 17];
const dates = [1, 2, 3, 4, 5, 6, 7];
const trueTimes = times.map(time => (time * 4) + 1);
dates.forEach(date => {
trueTimes.forEach(time => {
const personSlot = document.querySelector(`body > app-root > app-calendar > mat-sidenav-container > mat-sidenav-content > div > fm-calendar > div > div.fm-scrollable-cal > div.cal-slots > div:nth-child(${date}) > mat-grid-list > div > mat-grid-tile:nth-child(${time}) > figure > app-session-tile > div > div.fm-empty-left-side.ng-star-inserted `);
const emptySlot = document.querySelector(`body > app-root > app-calendar > mat-sidenav-container > mat-sidenav-content > div > fm-calendar > div > div.fm-scrollable-cal > div.cal-slots > div:nth-child(${date}) > mat-grid-list > div > mat-grid-tile:nth-child(${time}) > figure > app-session-tile > div`);
personSlot ? personSlot.click() : emptySlot ? emptySlot.click(): null;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment