Comments for "Date_Holidays"

» Submit Your Comment
Comments are only accepted during the "Proposal" phase. This proposal is currently in the "Finished" phase.
» Comments
  • Lorenzo Alberton  [2004-06-20 13:09 UTC]

    This is a package that can be really useful, a perfect companion to PEAR::Calendar. Thanks for proposing it!

    Just a few suggestions:
    don't store holidays in the class, but provide a method to import them from a datasource (.ini file, database, whatever). The class
    should provide some baked data files as examples, but the final user must be able to customize his data (maybe he wants to filter some holidays out). Also, the final user probably prefers handling simple text files than writing new classes just to add a few holidays:
    =====[myFeasts.ini]==========
    [newYearsEve]
    dateType = fixed
    month = 1
    day = 1

    [Whitsun]
    dateType = floating
    date = [Easter] + 49
    =============================


    <shameless plug>
    Internationalization management could be delegated to external classes like PEAR::Translation2 [1] & [2], and Localization to PEAR::I18Nv2 [3] & [4]
    </shameless plug>


    Is there any difference between Date_Holidays_Driver_Christian::_calcEaster() and the php function easter_date()? [5]

    I don't know if it is useful, but what about separating/differentiating fixed-date holidays (new year's eve) from floating-date ones (Easter)? (See .ini example above)

    Some other pedantic notes:
    - please always use english names ($jahr => $year)
    - Even if the studlyCaps convention for holiday names is ok, they should start with a capital letter ('petrusAndPaulus' => 'PetrusAndPaulus')

    [1] http://pear.php.net/package/Translation2
    [2] http://pear.php.net/manual/en/package.internationalization.translation2.php
    [3] http://pear.php.net/package/I18Nv2
    [4] http://pear.php.net/manual/en/package.internationalization.php
    [5] http://www.php.net/easter_date


    Anyway, this is a pretty nice package!

    Cheers,
    --
    Lorenzo Alberton
    http://pear.php.net/user/quipo
  • Sérgio Carvalho  [2004-06-20 17:50 UTC]

    First, let me tell this package looks really great! It's clearly stuff I'd use time and time again. Great idea, Carsten.

    I'd like to comment a few things. First, I agree with <a href="http://pear.php.net/pepr/pepr-comments-show.php?id=85">Lorenzo</a>. The sheer ammount of different holidays will require that the author can accept contributions of holiday description data. It will be much easier for people to contribute holiday lists if no code needs to be written. The package should define a description format for holiday calendars.

    Then, I'd like to know how can City holiday calendars be handled. In Portugal, at least, each city may define its own city holiday. The rest of the holiday calendar is common country-wide. Would a specific class need to be defined for each city, and the combined with the country calendar class? Won't this result in an explosion of classes to an exotic number?
  • Antônio Carlos Venâncio Júnior  [2004-06-21 12:06 UTC]

    Are you planning to add support to differentiate national/state/city holidays?