Avatar

gaetgu

6 public vals
Joined January 13, 2023
1
2
3
4
5
6
7
8
9
10
import { currentDay } from "https://esm.town/v/gaetgu/currentDay";
import { finishedDays } from "https://esm.town/v/gaetgu/finishedDays";
export let remind_myself = () => {
if (new Date().getHours() == 16) {
if (finishedDays < currentDay) {
console.email("Go running you wimp! Do it now!", "RUNNNNNNN");
}
}
};
1
2
3
4
5
6
7
8
9
10
import { currentDay } from "https://esm.town/v/gaetgu/currentDay";
import { finishedDays } from "https://esm.town/v/gaetgu/finishedDays";
export let remind_all_participants = () => {
if (new Date().getHours() == 16) {
if (finishedDays < currentDay) {
console.email("Go running you wimp! Do it now!", "RUNNNNNNN");
}
}
};
1
export let currentDay = 2;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { complete_day } from "https://esm.town/v/gaetgu/complete_day";
import { currentDay } from "https://esm.town/v/gaetgu/currentDay";
import { finishedDays } from "https://esm.town/v/gaetgu/finishedDays";
export let finish_rest_day = () => {
if (finishedDays == currentDay) {
return;
}
var date = new Date();
switch (date.getDay()) {
case 1:
complete_day("Rest Day");
break;
case 4:
complete_day("Rest Day");
break;
default:
break;
}
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { complete_day } from "https://esm.town/v/gaetgu/complete_day";
import { currentDay } from "https://esm.town/v/gaetgu/currentDay";
import { finishedDays } from "https://esm.town/v/gaetgu/finishedDays";
export let finish_today = () => {
if (finishedDays == currentDay) {
return;
}
var date = new Date();
// Rest days are handled in a separate, scheduled function.
switch (date.getDay()) {
case 0:
complete_day("Long Run"); // Sunday!
break;
case 2:
complete_day("Pace Run");
break;
case 3:
complete_day("Training Run");
break;
case 4:
case 5:
complete_day("Training Run");
break;
case 6:
complete_day("Strength Training");
break;
default:
break;
}
};
1
2
3
4
import { days_completed } from "https://esm.town/v/gaetgu/days_completed";
export let complete_day = (type) =>
days_completed.push({ time: Date.now().toString, type });
Next