Skip to main content

dateUtil

An utility module for working with dates.

Functions

yearIsLeapYear

dateUtil.yearIsLeapYear(yearnumber) → boolean

Returns a boolean indicating whether or not the given year is a leap year.

print(dateUtil.yearIsLeapYear(2024)) --> true

stringifiedMonth

dateUtil.stringifiedMonth(monthnumber) → string

Returns a stringified month.

print(dateUtil.stringifiedMonth(3)) --> "March"

daysInMonth

dateUtil.daysInMonth(
yearnumber,
monthnumber
) → number

Returns the number of days in the given month.

print(dateUtil.daysInMonth(2023, 6)) --> 30
Show raw api
{
    "functions": [
        {
            "name": "yearIsLeapYear",
            "desc": "Returns a boolean indicating whether or not the given year is a leap year.\n\n```lua\nprint(dateUtil.yearIsLeapYear(2024)) --> true\n```",
            "params": [
                {
                    "name": "year",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 35,
                "path": "src/dateUtil/init.luau"
            }
        },
        {
            "name": "stringifiedMonth",
            "desc": "Returns a stringified month.\n\n```lua\nprint(dateUtil.stringifiedMonth(3)) --> \"March\"\n```",
            "params": [
                {
                    "name": "month",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/dateUtil/init.luau"
            }
        },
        {
            "name": "daysInMonth",
            "desc": "Returns the number of days in the given month.\n\n```lua\nprint(dateUtil.daysInMonth(2023, 6)) --> 30\n```",
            "params": [
                {
                    "name": "year",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "month",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 59,
                "path": "src/dateUtil/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "dateUtil",
    "desc": " \n\nAn utility module for working with dates.",
    "source": {
        "line": 6,
        "path": "src/dateUtil/init.luau"
    }
}