Skip to content

Return of Reckoning

Wiki

RoR Wiki

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 – true for the short form of the name, false for 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 monthIndex outside 1–12 the client logs the Invalid month index error and returns nothing.
  • abbreviated must be a real boolean. Passing nil or 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 )

See also