Hi all, I'm working on RT4 and very happily gutting our currently ad hoc date handling (a hodgepodge of Time::Local, Time::ParseDate, POSIX::tzset, and a lot of date/time logic) with DateTime. We're subclassing DateTime and it turns out we need to subclass DateTime::Duration as well. As Dave and I have learned from working with Class::MOP and Moose, it's very useful for extensibility to have class names be retrieved with method dispatch.
This patch makes the duration class of DateTime easily changeable. It defines a duration_class method in DateTime for subclasses to override; it just returns the string "DateTime::Duration" so there's no worry about back-compat issues. It also adds some tests. Thanks, Shawn
duration_class.diff
Description: Binary data