onViewChange( )


Adds an event handler that triggers when the appointment field's year or month changes.

When a site visitor views a new month or year in the appointment field's date picker, the operation function is called. When the operation function returns, the returned object is passed to the event handler in the options.operationResult object. Each time a site visitor enters the date picker, the onViewChange event is triggered. Selecting a day in the displayed month does not trigger the event handler.

Note: The operation function is called each time the month or year changes and the onViewChange event is triggered. If the operation function takes time to return there can be more than 1 instance of the function running when a site visitor clicks multiple times on the next month arrow. In these cases, only the last triggered operation is returned to the event handler and the handler only runs once.

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

handler(event: ViewChangeEvent): void Name of the function or the function expression that is called when the appointment field's month or year changes.


operationfunction

operation(options: OperationOptions): any Name of an async function that is called when an appointment field's month or year changes. The operation result is passed to the handler in the event's options.operationResult object.


timeoutnumber

Number of milliseconds to wait for the operation to return. If the operation doesn't resolve before the timeout, an error is returned. Defaults to 10,000.

Was this helpful?
Yes
No