On Thu, 27 Feb 2003, Rick Measham wrote:

> $DTM = DateTime::Calendar::Metric->new(year=>2003, day=>58.5);
>
> Then I'll work on DateTime::Calendar::Metric::Revolutionary (or
> DateTime::Calendar::Metric::Format::Revolutionary -- Dave?) which will
> extend the Metric system to understand months/weeks/hours/mins/secs in the
> various formats.

If each one takes different constructor params, then they're different
calendars, not just different formats for the _same_ calendar, right?

But either way, call it "FrenchRevolutionary", I think.

> All the above will return the same for:
> $DT = $DTM->datetime_object()
> or whatever its called.

Ack!  Your calendar object is not responsible for returning other calendar
objects!  That way lies madness.  If there are 20 calendar modules, does
each one have 19 methods, each of which produces one other calendar?  No,
that'd be a nightmare.

All you have to implement is utc_rd_values and from_object.  The former
method is called in any other calendar modules from_object() method, and
the latter method implements UTC RD -> metric calendar flavor conversion.

Take a look at how these methods (particularly from_object()) work in
DateTime.pm.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to