I was intrigued by the JavaScript peppered at the end of Basecamp website for the sign-off greeting:

“Basecamp greeting”

Using the JavaScript Internationalization APIs, we can achieve this using the following steps:

  1. Determine the current date/time at browser location
  2. Determine the locale (combination of language and region) of the browser
  3. Combine it all - Voilà!
var dt = new Date();
console.log(dt);
var perLocale = navigator.language;
console.log(perLocale);
var daySpelt = new Intl.DateTimeFormat(perLocale, { weekday: "long" }).format(
  dt
);
console.log("Enjoy the rest of your " + daySpelt + "!");