Discussion:
XML format for calendars
Mikael Hallendal
2002-12-09 11:36:38 UTC
Permalink
Hi!

Going to start adding support for reading/writing the calendar data that
me and Richard has been implementing lately.

I was thinking something like this:


<calendars>
<day-types>
<!-- Day types are project wide -->
<day-type id="1" name="Work day" description="A working day">
<interval start="08.30" end="11.30"/>
<interval start="12.30" end="17.30"/>
</day-type>
<day-type id="2" name="Nonwork day" description="A nonworking day"/>
<day-type id="3" name="My day type" description="I'm sleep late">
<interval start="10.00" end="13.00"/>
<interval start="13.30" end="18.30"/>
</day-type>
</day-types>

<calendar name="Base calendar">
<!-- Set the default week -->
<default-week mon="1" tue="1" wed="1" thu="1" fri="1"
sat="2" sun="2"/>
<day-types>
<!-- Override day types -->
<day-type id="1">
<!-- Make the working day start later and have shorter lunch -->
<interval start="09.00" end="12.00"/>
<interval start="12.30" end="17.30"/>
</day-type>
</day-types>
<days>
<!-- Override specific dates -->
<day date="20021202" type="day-type">2</day>
<day date="20021203" type="custom">
<interval start="09.30" end="12.30"/>
<interval start="13.00" end="17.00"/>
</day>
</days>

<calendar name="My own calendar">
<!-- Derived calendar, days not overridden will be read
from Base -->
<default-week mon="1" tue="1" wed="1" thu="3" fri="3"
sat="2" sun="2"/>
</calendar>
</calendar>
</calendars>

What we have done is that you define a number of day types, these types
have a name, a description and a set of default intervals. The default
intervals can later be overridden in the calendars.

All time is thought of as non-working time and all inetervals define
working time.

In the default week you define what day types the days of the week
should have, the default week can then be overridden in a derived
calendar.

The custom day type is to be able to just say "I want to change that day
without having to define a new day type for doing so"...

So, comments please.

Regards,
Mikael Hallendal
--
Mikael Hallendal ***@codefactory.se
CodeFactory AB http://www.codefactory.se/
Cell: +46 (0)709 718 918
Roberto Perez
2002-12-09 22:50:38 UTC
Permalink
Post by Mikael Hallendal
Hi!
Going to start adding support for reading/writing the calendar data that
me and Richard has been implementing lately.
<calendars>
<day-types>
<!-- Day types are project wide -->
<day-type id="1" name="Work day" description="A working day">
<interval start="08.30" end="11.30"/>
<interval start="12.30" end="17.30"/>
</day-type>
<day-type id="2" name="Nonwork day" description="A nonworking day"/>
<day-type id="3" name="My day type" description="I'm sleep late">
<interval start="10.00" end="13.00"/>
<interval start="13.30" end="18.30"/>
</day-type>
</day-types>
<calendar name="Base calendar">
<!-- Set the default week -->
<default-week mon="1" tue="1" wed="1" thu="1" fri="1"
sat="2" sun="2"/>
<day-types>
<!-- Override day types -->
<day-type id="1">
<!-- Make the working day start later and have shorter lunch -->
<interval start="09.00" end="12.00"/>
<interval start="12.30" end="17.30"/>
</day-type>
</day-types>
<days>
<!-- Override specific dates -->
<day date="20021202" type="day-type">2</day>
<day date="20021203" type="custom">
<interval start="09.30" end="12.30"/>
<interval start="13.00" end="17.00"/>
</day>
</days>
<calendar name="My own calendar">
<!-- Derived calendar, days not overridden will be read
from Base -->
<default-week mon="1" tue="1" wed="1" thu="3" fri="3"
sat="2" sun="2"/>
</calendar>
</calendar>
</calendars>
What we have done is that you define a number of day types, these types
have a name, a description and a set of default intervals. The default
intervals can later be overridden in the calendars.
All time is thought of as non-working time and all inetervals define
working time.
In the default week you define what day types the days of the week
should have, the default week can then be overridden in a derived
calendar.
The custom day type is to be able to just say "I want to change that day
without having to define a new day type for doing so"...
So, comments please.
Regards,
Mikael Hallendal
Hi!


I think that it is a good design but i have a question. I dont know
exactly which are the puposes of calendar but, wouldn't it be a good
idea to include who is working in each interval ?

<interval start="10.00" end="13.00" workers="Sandy, John">

Regards
Roberto.
--
Roberto Perez <HYLIAN-***@terra.es>
Mikael Hallendal
2002-12-09 21:59:35 UTC
Permalink
Post by Roberto Perez
I think that it is a good design but i have a question. I dont know
exactly which are the puposes of calendar but, wouldn't it be a good
idea to include who is working in each interval ?
<interval start="10.00" end="13.00" workers="Sandy, John">
That information doesn't go here (it's part of the allocations). The
interval just says that in a particular calendar there is a working
interval between 1000 and 1300. If a resource uses this calendar he will
be assigned to work on his tasks between these times.

Regards,
Mikael Hallendal
--
Mikael Hallendal ***@codefactory.se
CodeFactory AB http://www.codefactory.se/
Cell: +46 (0)709 718 918
Philippe Coulonges
2002-12-09 22:14:03 UTC
Permalink
Le 09 Dec 2002 12:36:38 +0100
Hi!
Hello, my first post here.

How do you plan to manage holidays in your calendar ?
I don't mean holydays that comes at a fixed date, but holydays defined
as "third wednesday of that month" ?

That an important notion, especially for i18n calendars.

CU
CPHIL
- --
.. On lit, dit-on, dans votre ouvrage, la proposition que voici :
"La liberté est le droit de faire ce que les lois permettent."
Je m'accommode très bien de cette définition que je trouve juste,
et je puis vous assurer que mes lois ne permettront que ce qu'il
faudra..
-- Machiavel (lettre à Montesquieu).
Mikael Hallendal
2002-12-09 22:41:59 UTC
Permalink
Post by Philippe Coulonges
Hello, my first post here.
Hi and welcome :)
Post by Philippe Coulonges
How do you plan to manage holidays in your calendar ?
I don't mean holydays that comes at a fixed date, but holydays defined
as "third wednesday of that month" ?
That an important notion, especially for i18n calendars.
Our plan is to have two day types that are always available (Working day
and Nonworking day).

Then a user can define his own working days if he needs.

For your example I guess he can just set the third Wednesday of a
particular month to "Nonworking day" or if he needs a special kind he
can define his own day type "Holiday" and set that date to be of type
"Holiday".

In the future we plan to have support for "Custom" day type where you
just define the intervals for a particular date without having to define
a day type first.

Regards,
Mikael Hallendal
--
Mikael Hallendal ***@codefactory.se
CodeFactory AB http://www.codefactory.se/
Cell: +46 (0)709 718 918
Christian Rose
2002-12-10 12:17:07 UTC
Permalink
Post by Mikael Hallendal
<day-type id="1" name="Work day" description="A working day">
<interval start="08.30" end="11.30"/>
Minor nitpick: Although "08.30" is an accepted and official format in
some countries, ISO 8601 (http://www.cl.cam.ac.uk/~mgk25/iso-time.html)
specifies the use of colon as the separator, or no separator at all. So
"08:30" or "0830" should probably be used in the file format.


Christian
Mikael Hallendal
2002-12-10 13:24:21 UTC
Permalink
Post by Christian Rose
Post by Mikael Hallendal
<day-type id="1" name="Work day" description="A working day">
<interval start="08.30" end="11.30"/>
Minor nitpick: Although "08.30" is an accepted and official format in
some countries, ISO 8601 (http://www.cl.cam.ac.uk/~mgk25/iso-time.html)
specifies the use of colon as the separator, or no separator at all. So
"08:30" or "0830" should probably be used in the file format.
It's 0830, I was just mocking things up for an example. Thanks.

Regards,
Mikael Hallendal
--
Mikael Hallendal ***@codefactory.se
CodeFactory AB http://www.codefactory.se/
Cell: +46 (0)709 718 918
Loading...