Branch: Tag:

2014-08-25

2014-08-25 15:48:09 by Per Hedbor <ph@opera.com>

[autodoc] Added Calendar documentation from the FAQ.

It is actually rather useful. But very hard to find

16:    combine_path(__FILE__,"../events/regional"));   }    +  + //! The Event system + //! + //! Q: How do I find out which days are red in a specific region? + //! + //! A: Events.<region> + //! + //! - contains the events for the region, as a SuperEvent. + //! You can ask this object to filter out the holidays, + //! + //! @code + //! Events.se.holidays(); + //! @endcode + //! + //! Which will be a superevent containing only holidays. + //! + //! To use this information, you can for instance use ->scan, + //! here in an example to see what red days there were in Sweden + //! in 2001 + //! + //! @code + //! > Calendar.Events.se->filter_flag("h")->scan(Calendar.Month()); + //! Result: ({ /* 6 elements */ + //! Day(Sun 7 Jan 2001), + //! Day(Sun 14 Jan 2001), + //! Day(Sun 21 Jan 2001), + //! Day(Sun 28 Jan 2001), + //! Day(Sat 6 Jan 2001), + //! Day(Mon 1 Jan 2001) + //! @endcode +    Event.Event make_event(string source)   {    string id;
201:    combine_path(__FILE__,"../events/namedays"));   }    +    Event.Namedays find_namedays(string region)   {    string id="namedays/"+region;
393:      // -----------------------------------------------------------------------    + //! @decl Event.Event `[](string region) + //! @decl Event.Event `->(string region) + //! + //! return the Event object for the specified region or the specified + //! named event. +    program|Event.Event `[](string s)   {    return ::`[](s) || magic_event(s);