rec_type structure questions

Hi there, I have a few questions concerning the rec_type structure used in recurring events. Here’s a copy-paste of the doc found here:

docs.dhtmlx.com/doku.php?id=dhtm … ing_events

My questions are essentially related to the last two examples. First of all, concerning the third one which is the second monday of each month, the 2 which identifies the “second” is placed in the [day] field and the 1 which identifies “monday” is placed in the [count2] field. Intuitively, I would have thought it to be the other way around whereas [count2] would identify the sequence of the day in the month and [day] the day of the week itself. So basically, according to my intuitive approach, the third example would actually be the first Tuesday of every month, not second Monday. So anyway, what I essentially want to know is: Am I correct or is the example correct?

My next question is actually really simple and it relates to the days of the week. Now, according to the last example, Monday is 1 and Friday is 5. So based on this, Saturday is logically 6… but what about Sunday? Is it value 0 or value 7?

Anyway, thanks in advance

Osu

So anyway, what I essentially want to know is: Am I correct or is the example correct?
The sample is correct, order of params
month_1_1_2_
{monthly}{each 1 month}{monday}_{second}

I’m agree that existing description is a bit confusing, we will check how it can be improved.

but what about Sunday? Is it value 0 or value 7?
Sunday is 0, we are using js Date convention where it possible

Thanks a lot for your explanation :slight_smile: and actually, what’s confusing is not the description of the parameters, it’s their names.

For example, you have the parameter “count” which gives the size of the interval (i.e. 1 week, 2 months and so forth). So when someone sees “count2” he would naturally thinks its function is similar to that of “count” in that it describes some sort of interval, but it’s actually used to identify a day of the week.

But where the real confusion lies is in the “day” versus “days” parameter. Now, the name “days” is intuitively correct I believe since this parameter is used to list days of the week… but then one would naturally expects parameter “day” to be used for a similar purpose since its name is so resemblant, but in this case, it’s used to identify a sequence number (which is why I was so confused).

Anyway, one possible fix would be to simply swap the name of “count2” and “day” parameters, thus making things much more intuitive to understand. But of course, that’s just my personal interpretation and it might just be me who thinks opposite of everyone else :wink:.

So with that said, I hope my opinion was somewhat useful and thanks again for your explanation.

Osu