Skip to content

Instantly share code, notes, and snippets.

@Eunoia
Created August 18, 2020 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eunoia/ec0214834eed9136226fd01b5b8fa9a2 to your computer and use it in GitHub Desktop.
Save Eunoia/ec0214834eed9136226fd01b5b8fa9a2 to your computer and use it in GitHub Desktop.
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