Created
August 18, 2020 02:27
-
-
Save Eunoia/ec0214834eed9136226fd01b5b8fa9a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatedDate(offset = 7) { | |
da = new Date(); | |
da.setDate(da.getDate() - offset); | |
y = da.getFullYear(); | |
m = da.toLocaleString("default", { month: "long" }); | |
d = da.getDate(); | |
ord = ""; | |
switch (da.getDate()) { | |
case 1: | |
case 21: | |
ord = "st"; | |
break; | |
case 2: | |
case 22: | |
case 32: | |
ord = "nd"; | |
break; | |
case 3: | |
case 33: | |
ord = "rd"; | |
break; | |
default: | |
ord = "th"; | |
} | |
ord += ","; | |
d += ord; | |
f = [m, d, y].join(" "); | |
return f; | |
} | |
a = ["Three Days Ago [[", formatedDate(3), "]]"].join(""); | |
b = ["One Week Ago [[", formatedDate(7), "]]"].join(""); | |
c = ["One Moon Ago [[", formatedDate(28), "]]"].join(""); | |
r = `-Retrospective: | |
- ${a} | |
- ${b} | |
- ${c}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment