numberAsWeekday
Returns the weekday name for the input number — e.g. Tuesday for 2.
You can pick which language the function uses by specifying a locale in the second parameter.
The default language is US English.
To perform the reverse operation, use the weekdayAsNumber function.
Parameters
WEEKDAY NUMBER (number)
The input number. This must be an integer between 1 and 7 (inclusive).
LOCALE (string)
Optional. Determines which language the function uses for the output text. All supported locales are included in the parameter dropdown in the Funciton Builder.
Default: en_US
Examples
ATL in Script | Result | Notes |
---|---|---|
| Sunday | The locale code is en_US (default), so the function returns the first day of the week in English (United States). This locale starts the week on Sunday. |
| Lundi | The locale code is fr_FR, so the function returns the first day of the week in French (France). This locale starts the week on Monday. |
| Martes | The locale code is es_ES, so the function returns the second day of the week in Spanish (Spain). This locale starts the week on Monday. |
| Среда | The locale is ru_RU, so the function returns the third day of the week in Russian (Russia). This locale starts the week on Monday. |
| 星期三 | The locale is zh_CH, so the function returns the fourth day of the week in Chinese (China). This locale starts the week on Sunday. |
Studio automatically capitalizes the first letter of a new sentence — this is why the Result column shows some weekday names with initial capitalization, even though that isn't the convention in the selected language.
If you use numberAsWeekday
mid-sentence, you see the correct capitalization applied.
ATL in Script | Result |
---|---|
| The French word for Tuesday is mardi |
Tip
You can turn off automatic capitalization in your project settings. See Settings > Postprocessing.