Event entity

Contains title, dates of start and end, description, location and attendees.

Hierarchy

  • Event

Constructors

  • Parameters

    • title: string

      Event title.

    • startDate: Date

      Event start date and time. For all day events it's enough to pass only date without time.

    • Optional endDateOrDuration: null | number | Date

      Event date end or event duration in minutes. Leave empty for all day events.

    • Optional description: string

      Details about the event.

    • Optional location: Location

      Place of the event. Place name are required, geo coordinates are optional.

    • attendees: Attendee[] = []

      List of people to invite. The first one will be considered as the event organizer.

    • Optional uid: string

      Unique identifier of the event. Applicable only to ics files. Gives possibility to update the event invitation in the future by follow up email. If not provided, it will be generated automatically.

    Returns Event

Properties

_attendees: Attendee[]
_endDate: null | Date = null
_startDate: Date
description?: string

Details about the event.

duration: null | number = null
location?: Location

Place of the event. Place name are required, geo coordinates are optional.

title: string

Event title.

uid?: string

Unique identifier of the event. Applicable only to ics files. Gives possibility to update the event invitation in the future by follow up email. If not provided, it will be generated automatically.

Accessors

  • get endDate(): Date
  • Returns Date

  • get locationCoordinates(): undefined | LocationCoordinates
  • Returns undefined | LocationCoordinates

  • get locationName(): undefined | string
  • Returns undefined | string

  • get startDate(): Date
  • Returns Date

Methods

  • Returns void

  • Parameters

    • date: Date

    Returns string

  • Returns string

  • Returns Date

  • Returns string

  • Parameters

    • duration: undefined | null | number | Date

    Returns undefined | null | number | Date

  • Returns boolean

  • Check if the event is all day long

    Returns

    Event is all day or not.

    Returns boolean

  • Reschedule the event.

    // manage all day event
    const event = new Event('Hiking', new Date(2021, 6, 8))
    event.reschedule(new Date(2021, 6, 8))

    // covert general event to all day
    event.reschedule(new Date(2021, 6, 8), null)

    // change start date and time and set duration
    event.reschedule(new Date(2021, 6, 8, 12, 0), 45)

    // change start date and time, but leave the same duration
    event.reschedule(new Date(2021, 6, 8, 13, 0))

    // use end date instead of duration
    event.reschedule(new Date(2021, 6, 8, 13, 0), new Date(2021, 6, 8, 13, 45))

    Returns

    The event. You can chain this method.

    Parameters

    • startDate: Date

      Event start date and/or time.

    • Optional endDateOrDuration: null | number | Date

      Event date end or event duration in minutes. Leave empty for all day events or keep previously set duration.

    Returns Event

  • Parameters

    • Optional endDateOrDuration: null | number | Date

    Returns void

Generated using TypeDoc