Function parseStringMonth

  • Parses a string into a CronMonth.

    Example

    parseStringMonth("10"); // 10
    parseStringMonth("*"); // "*"
    parseStringMonth("2/6"); // { every: 6, start: 2 }
    parseStringMonth("?/6"); // { every: 6, start: "?" }
    parseStringMonth("1,2,3,4"); // [1, 2, 3, 4]
    parseStringMonth("1-5"); // { from: 1, to: 5 }
    parseStringMonth("JAN-OCT"); // { from: "JAN", to: "OCT" }
    parseStringMonth("jan-oct"); // { from: "JAN", to: "OCT" }
    parseStringMonth("1,2,3,5-7"); // [1, 2, 3, { from: 5, to: 7 }]
    parseStringMonth("INVALID"); // undefined
    parseStringMonth("1,2,3,4,INVALID"); // undefined

    Returns

    A CronMonth or undefined if invalid.

    Parameters

    • source: string

      string to be parsed.

    Returns Maybe<CronPart<CronMonthValue>>