API:GetMonthName
From RoR Wiki
UI Lua API · Time functions
Version: WAR 1.4.8
Returns the name of a month in the language of the computer's regional settings.
name = GetMonthName(monthIndex, abbreviated)
Arguments
- monthIndex
number– Month, 1 (January) to 12 (December). Fractions are dropped.- abbreviated
boolean–truefor the short form of the name,falsefor the full name.
Returns
- name
wstring– The month name.
Details
- The name comes from Windows' locale data for the current thread locale, not from the game's string tables.
- If Windows cannot supply the name, an empty string is returned.
- With a
monthIndexoutside 1–12 the client logs the Invalid month index error and returns nothing. abbreviatedmust be a real boolean. Passingnilor a number raises an Invalid Parameters error.- The function needs at least two arguments and only reads the last two.
- The stock UI never calls
GetMonthName.
Errors
This is written to the UI log; the call returns normally.
Error in function call 'GetMonthName': Invalid month index.
Example
A minimal example built from the signature above:
local fullName = GetMonthName( 3, false ) local shortName = GetMonthName( 3, true )
