Package org.daiitech.naftah.utils.time
Class DayOfWeekUtils
java.lang.Object
org.daiitech.naftah.utils.time.DayOfWeekUtils
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent instantiation. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDayOfWeek(int dayOfWeek) Converts a numeric day-of-week to its name.
-
Field Details
-
WEEK_DAYS
names of the week (Monday = 1, Sunday = 7).
-
-
Constructor Details
-
DayOfWeekUtils
private DayOfWeekUtils()Private constructor to prevent instantiation.
-
-
Method Details
-
getDayOfWeek
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
-