<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetWeekDayName</id>
	<title>API:GetWeekDayName - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetWeekDayName"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetWeekDayName&amp;action=history"/>
	<updated>2026-10-17T17:54:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetWeekDayName&amp;diff=30487&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetWeekDayName&amp;diff=30487&amp;oldid=prev"/>
		<updated>2026-10-16T19:45:21Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Time}}&lt;br /&gt;
Returns the name of a day of the week in the language of the computer&amp;#039;s regional settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
name = GetWeekDayName(dayIndex, abbreviated)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;dayIndex : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Day of the week, 1 to 7: 1 is Monday, 7 is Sunday. Fractions are dropped.&lt;br /&gt;
;abbreviated : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for the short form of the name, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for the full name.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;name : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – The day name.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The name comes from Windows&amp;#039; locale data for the current thread locale, not from the game&amp;#039;s string tables. The full names are the locale&amp;#039;s day names, the short ones its abbreviated day names.&lt;br /&gt;
* The day numbering matches [[API:GetFirstDayOfWeek|GetFirstDayOfWeek]].&lt;br /&gt;
* If Windows cannot supply the name, an empty string is returned.&lt;br /&gt;
* With a &amp;lt;code&amp;gt;dayIndex&amp;lt;/code&amp;gt; outside 1–7 the client logs the &amp;#039;&amp;#039;Invalid day index&amp;#039;&amp;#039; error and returns nothing.&lt;br /&gt;
* &amp;lt;code&amp;gt;abbreviated&amp;lt;/code&amp;gt; must be a real boolean. Passing &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; or a number raises an &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; error.&lt;br /&gt;
* The function needs at least two arguments and only reads the last two.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
This is written to the UI log; the call returns normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetWeekDayName&amp;#039;: Invalid day index.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Filling the weekday header of the guild calendar with the first letter of each short name, from &amp;lt;code&amp;gt;ea_guildwindow/source/calendar.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local dayIndex = GetFirstDayOfWeek()&lt;br /&gt;
for labelIndex = 1, 7&lt;br /&gt;
do&lt;br /&gt;
    LabelSetText( &amp;quot;GuildWindowCalendarDOTW&amp;quot;..labelIndex, wstring.sub( GetWeekDayName( dayIndex, true ), 0, 1 ) )&lt;br /&gt;
    dayIndex = dayIndex + 1&lt;br /&gt;
    if ( dayIndex &amp;gt; 7 )&lt;br /&gt;
    then&lt;br /&gt;
        dayIndex = dayIndex - 7&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetFirstDayOfWeek|GetFirstDayOfWeek]]&lt;br /&gt;
* [[API:GetMonthName|GetMonthName]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>