API:GetFirstDayOfWeek
From RoR Wiki
UI Lua API · Time functions
Version: WAR 1.4.8
Returns the first day of the week according to the computer's regional settings.
dayIndex = GetFirstDayOfWeek()
Arguments
None.
Returns
- dayIndex
number– 1 to 7: 1 is Monday, 7 is Sunday.
Details
- The value comes from the Windows "first day of week" setting of the current thread locale. It uses the same numbering as GetWeekDayName.
- If the setting cannot be read, 1 (Monday) is returned.
- Arguments are not checked; anything passed is ignored.
Errors
None.
Example
From ea_guildwindow/source/calendar.lua:
local dayIndex = GetFirstDayOfWeek()
for labelIndex = 1, 7
do
LabelSetText( "GuildWindowCalendarDOTW"..labelIndex, wstring.sub( GetWeekDayName( dayIndex, true ), 0, 1 ) )
dayIndex = dayIndex + 1
if ( dayIndex > 7 )
then
dayIndex = dayIndex - 7
end
end
