weekDays example


  public static function dayOfWeekName($date = NULL, $abbr = TRUE) {
    $date = $date ?? 'now';
    if (!$date instanceof DrupalDateTime) {
      $date = new DrupalDateTime($date);
    }
    if (!$date->hasErrors()) {
      $dow = self::dayOfWeek($date);
      $days = $abbr ? self::weekDaysAbbr() : self::weekDays();
      return $days[$dow]->getUntranslatedString();
    }
    return NULL;
  }

}
Home | Imprint | This part of the site doesn't use cookies.