Skip to content

Commit 3229866

Browse files
committed
[update] onbeforeviewchange article
Refresh event signature and clean view-change details
1 parent e762d49 commit 3229866

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

docs/api/event/onbeforeviewchange.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ description: "fires before the user changes the current view to some other one"
1010

1111
@short: Fires before the user changes the current view to some other one
1212

13-
@signature: onBeforeViewChange: (old_mode: string, old_date: object, mode: string, date: object) =\> boolean
13+
@signature: onBeforeViewChange: (old_mode: string, old_date: Date, mode: string, date: Date) =\> boolean
1414

1515
### Parameters
1616

1717
- `old_mode` - (required) *string* - the currently active view
18-
- `old_date` - (required) *object* - the currently active date
18+
- `old_date` - (required) *Date* - the currently active date
1919
- `mode` - (required) *string* - the new view
20-
- `date` - (required) *object* - the new date
20+
- `date` - (required) *Date* - the new date
2121

2222
### Returns
23-
- ` result` - (boolean) - defines whether the default action of the event will be triggered (<b>true</b>) or canceled (<b>false</b>)
23+
- `result` - (boolean) - defines whether the default action of the event will be triggered (`true`) or canceled (`false`)
2424

2525
### Example
2626

2727
~~~jsx
28-
scheduler.attachEvent("onBeforeViewChange", function(old_mode,old_date,mode,date){
29-
//any custom logic here
28+
scheduler.attachEvent("onBeforeViewChange", (old_mode, old_date, mode, date) => {
29+
// any custom logic here
3030
return true;
3131
});
3232
~~~
@@ -36,5 +36,5 @@ scheduler.attachEvent("onBeforeViewChange", function(old_mode,old_date,mode,date
3636

3737
### Details
3838

39-
- The event is blockable. Return *false* and the scheduler will leave the current view opened.
40-
- The event also fires when the scheduler is initially being rendered on the page. In this case, the **old_mode** and **old_date** parameters are underfined.
39+
- The event is blockable. Return `false`, and the Scheduler will leave the current view open.
40+
- The event also fires when the Scheduler is initially rendered on the page. In this case, the `old_mode` and `old_date` parameters are undefined.

0 commit comments

Comments
 (0)