Please, pay attention to the fact that the “addMarkedSpan” and “deleteMarkedSpan” methods work correctly only when the “days” property matches.
It means that when you use new Date (date) or an array with weekdays in the “days” property in the “addMarkedSpan”, you should use the same in the “deleteMarkedSpan” method.
Here is the snippet where you can see how it should be:
So you mean there is no way if i have marked some dates by using new Date() method to some days i.e ( 2019-01-01 Monday — 2019-01-03 Wednesday — 2019-01-05 Friday )
And later on i just want to clear all marktimespans day wise… i.e [0,1,2,3,4,5,6] = all days…
Shouldn’t this work ?
Yes, if you set date new Date(2019,7,2) to the “days” property of addMarkedTimespan, and then specify integer numbers days: [1,5], corresponding to the days of the week in the “days” property of deleteMarkedTimespan - it will not work: http://snippet.dhtmlx.com/d8ec85bb3
You must use one of these ways for both methods.
If this isn’t possible how can i just clear all markings no matter with which method they were marked i.e … by day or new Date()… ?..
Also you can add and remove marked timespans dynamically.
You need to delete all timespans each time when you change the displayed range by prev/next buttons in the onBeforeViewChange handler.
Then check dates in the active view, put required of them to the array and set this array contains dates that you want to mark to the ‘days’ in addMarkedTimespan method when onViewChange handler fires.