Class: ScheduleCalendar

calendar.js~ScheduleCalendar()

new ScheduleCalendar()

Creates a new P48Schedule instance and initializes calendar state, event handlers and UI elements.
Source:

Methods

changeViewMode(mode)

Changes the view mode of the calendar after initialization. This method takes in one parameter. That parameter is the view mode you want the calendar to show. There is a list of view modes that work for this calendar. Some of those include timeGridDay dayGridWeek dayGridMonth dayGridYear multiMonthYear
Parameters:
Name Type Description
mode string The view mode the calendar switches to
Source:
Throws:
Throws if the value passed is not a string
Type
Error

createEventBlock(titleEvent, startDate, endDate, color, allDay, descriptionOfEvent)

Creates an event block and places it on the calendar. There are a lot of parameters that can be passed through. If a specific parameter is not wanted, simply pass in undefined to give a default value for that parameter. Default values are explained in each parameter description This method requires at least a two Date objects for the event to be placed in the calendar. If either or both is not passed, It will throw an error
Parameters:
Name Type Description
titleEvent string The title of the event. If none is given, the title will be "Event"
startDate Date A Date object that represents the start of the event.
endDate Date A Date object that represents the end of the event
color string A color for the event as a string. An input type color element with .value property will also work. if none is given, it will default to a blue color (#3788d8)
allDay boolean A boolean if the event will be all day or not, if the boolean is not true, it will default to false and the time will be 1 hour
descriptionOfEvent string A description of the event. If none is given, it will default to a empty string
Source:
Throws:
If the start and endDate variables are null or if they are not an instance of Date
Type
Error
Returns:
A FullCalendar Event object representing the event that was added

getIsCreatingSchedule() → {boolean}

Returns whether the client is making a schedule
Source:
Returns:
True if the client is making a schedule. Otherwise false.
Type
boolean

setIsCreatingSchedule(bool)

Sets the isCreatingSchedule boolean to the value given. Only works with boolean, nothing else.
Parameters:
Name Type Description
bool boolean The value the isCreatingSchedule will be set to.
Source:
Throws:
Throws if the value passed is not a boolean
Type
Error

setOptionForCalendar(optionName, value)

Changes an option of the calendar after initialization. This method takes in two parameters. The first parameter is the name of the calendar option that you want to change. The second option is to what you want to change it to.
Parameters:
Name Type Description
optionName string The calendar option you want to change
value * The value you want to assign the first parameter
Source: