First Wednesday calendar

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

First Wednesday calendar

Paul Clapham
I have been trying to create a calendar that will allow me to schedule tasks on (for example) the first Wednesday of the month.

So far I have a "Wednesday" calendar that allows me to schedule tasks every Wednesday. It's type "include" with "enable week days" and "Wednesday" checked off. This works fine.

Next I created a "FirstWednesday" calendar whose base calendar is the "Wednesday" calendar. I set it to be type "exclude" with "enable month days" and all the days from 8 to 31 checked off. I thought this would include only the Wednesdays whose date was in the first week of the month. However it will actually schedule tasks on any day between the 1st and the 7th regardless of whether it's a Wednesday. What have I done wrong here, and how can I do it correctly?

Here's the calendar entries from the router XML (this is version 6.1.0 by the way):

      <calendar name="FirstWednesday" base-calendar="Wednesday" enable-monthdays="true">
        <annualdays/>
        <date-ranges/>
        <monthdays day-08="true" day-09="true" day-10="true" day-11="true" day-12="true" day-13="true" day-14="true" day-15="true" day-16="true" day-17="true" day-18="true" day-19="true" day-20="true" day-21="true" day-22="true" day-23="true" day-24="true" day-25="true" day-26="true" day-27="true" day-28="true" day-29="true" day-30="true" day-31="true"/>
        <weekdays/>
      </calendar>
      <calendar name="Wednesday" enable-weekdays="true" type="include">
        <annualdays/>
        <date-ranges/>
        <monthdays/>
        <weekdays day-04="true"/>
      </calendar>
Reply | Threaded
Open this post in threaded view
|

Re: First Wednesday calendar

IIT Software
Administrator
A calendar overwrites it's base calendar. That works fine with annual days and date ranges because they contain only a specific part of a calendar but if you combine week days and month days, the top most calendar overwrites the other fully (week days and month days overlap fully). In your case you enable Wednesday in a base calendar but overwrite it by enabling month days 1-7 in the other calendar.

So in short, currently you can't create a "First Wednesday" calendar, except you specify it explicitly with annual days.

I'll check whether we can change the semantics if you have a single calendar and enable week days and month days to have an "AND" connection here. Then you would be able to have "First Wednesday" with a single calendar.
Reply | Threaded
Open this post in threaded view
|

Re: First Wednesday calendar

Paul Clapham
Thanks for the information. It wasn't clear from the documentation on the website.