Skip to content

Instantly share code, notes, and snippets.

@r2DoesInc
Created September 1, 2014 06:13
Show Gist options
  • Save r2DoesInc/bdcba8245fc3933bf679 to your computer and use it in GitHub Desktop.
Save r2DoesInc/bdcba8245fc3933bf679 to your computer and use it in GitHub Desktop.
Is there mail JS}
function doesTheMailRunToday(today)
{
var reason = '';
if (today.is().sunday())
reason = "It's Sunday.";
else if (today.equals(Date.parse("January 1")))
reason = "It's New Year's.";
else if (today.equals(Date.january().third().monday()))
reason = "It's Martin Luther King Day.";
else if (today.equals(Date.february().third().monday()))
reason = "It's Presidents' Day.";
else if (today.equals(Date.may().final().monday()))
reason = "It's Memorial Day.";
else if (today.equals(Date.parse("July 4")))
reason = "It's Independence Day.";
else if (today.equals(Date.september().first().monday()))
reason = "It's Labor Day.";
else if (today.equals(Date.october().second().monday()))
reason = "It's Columbus Day.";
else if (today.equals(Date.parse("November 11")))
reason = "It's Veterans' Day.";
else if (today.equals(Date.parse("November 12")) && today.is().monday())
reason = "It's Veterans' Day. (Observed)";
else if (today.equals(Date.november().fourth().thursday()))
reason = "It's Thanksgiving.";
else if (today.equals(Date.parse("December 25")))
reason = "It's Christmas.";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment