Function currentDateTimeDisplay

  • Gets the formatted display data for the current date and time of the active calendar, or the calendar with the passed in ID.

    Returns

    All the formatted display strings for the current date and time. Or if the passed in calendar can't be found, null.

    Example

    // Assuming a Gregorian calendar
    SimpleCalendar.api.currentDateTimeDisplay();
    //Returns a DateTime object like this
    // {
    // date: "June 01, 2021",
    // day: "1",
    // daySuffix: "st",
    // month: "6",
    // monthName: "June",
    // time: "00:00:00",
    // weekday: "Tuesday",
    // year: "2021",
    // yearName: "",
    // yearPostfix: "",
    // yearPrefix: ""
    // }

    Parameters

    • calendarId: string = 'active'

      Optional parameter to specify the ID of the calendar to get the current day from. If not provided the current active calendar will be used.

    Returns DateDisplayData | null