Class DayOfWeekUtils

java.lang.Object
org.daiitech.naftah.utils.time.DayOfWeekUtils

public final class DayOfWeekUtils extends Object
Utility class for converting numeric day-of-week values to names.

This class supports both Gregorian and Hijri calendars (names are the same).

Days are numbered 1–7 (Monday = 1, Sunday = 7).

Author:
Chakib Daii
  • Field Details

    • WEEK_DAYS

      private static final String[] WEEK_DAYS
      names of the week (Monday = 1, Sunday = 7).
  • Constructor Details

    • DayOfWeekUtils

      private DayOfWeekUtils()
      Private constructor to prevent instantiation.
  • Method Details

    • getDayOfWeek

      public static String getDayOfWeek(int dayOfWeek)
      Converts a numeric day-of-week to its name.
      Parameters:
      dayOfWeek - the day number (1 = Monday, ..., 7 = Sunday)
      Returns:
      name of the day
      Throws:
      IllegalArgumentException - if the day number is not in 1–7