Determines if the date falls on a weekend, according to local custom.


require(["dojo/date/locale"], function(locale){
  // Returns if current date is the weekend in the current locale

  // Returns if 10 Nov 2010 was a weekend in the current locale
  var date1 = new Date(2010, 10, 10);

  // Returns if 10 Nov 2010 was a weekend in the French locale
  locale.isWeekend(date1, "fr");


Argument Type Description
dateObject Date? Optional The date to check (default: today)
locale String? Optional Overrides the current locale

The function returns true if the date is on the weekend in the locale, otherwise false.


require(["dojo/date/locale", "dojo/dom", "dojo/domReady!"],
function(locale, dom){
  if (locale.isWeekend()){
    var output = "It is the weekend!";
    var output = "It is a weekday, get back to work!";
  dom.byId("output").innerHTML = output;
<div id="output"></div>
Error in the documentation? Can’t find what you are looking for? Let us know!