> I'm working with DateTime::Format::Natural and I really need a time-onlyobject. In fact I need an object that lets me chose what I want to give it.
Hi Rick,
I do agree with the need for the _ability_ to handle just times but I don't think it's worth the hassle of another class to deal with.
I'd like to see attributes that act as a mask for which information is valid. So perhaps there would be time_only() and date_only() constructors for DT.
time_only() would accept only hour/minute/seconds/tz/locale params and return an object with rd_days set to zero. Because of the attributes we could tell that date math with this object would be bogus.
This could easily done as a decorator class and I'll volunteer to write it if Dave agrees.
Sounds OK to me ..
Oh, and while we're at it, can there be any way to set an undefined datetime object constructor:
$undef = DateTime->undef();
This would normally only be used by module authors to return undef without dieing.
$dt = next_datetime_after_2003_where_year_is_2000;
$dt->year # month, day etc. returns undef
It's kind of like an infinite +/- datetime only its .. non existant!
$dt < $dt_inf; # always true $dt > $dt_inf; # always false
$dt < $dt_minus_inf; # always false $dt > $dt_minus_inf; # always true
$dt < $dt_undef; # always false $dt < $dt_undef; # always false $dt < $dt_undef; # always false
-- -------------------------------------------------------- There are 10 kinds of people: those that understand binary, and those that don't. -------------------------------------------------------- The day Microsoft makes something that doesn't suck is the day they start selling vacuum cleaners -------------------------------------------------------- "Write a wise proverb and your name will live forever." -- Anonymous --------------------------------------------------------
