> Flavio S. Glock <[EMAIL PROTECTED]> wrote:
> > sub has {
>
> I implemented this in CVS with tests, but I believe it
> should be 2 separate methods instead. What do
you think?
I'm cool with two different methods ... it really is two
different things. Maybe there's also a need for
has_any('hour', 'minute') which returns true if it has
either of hours or minutes.
> > > * can_be_datetime / become_datetime
> > sub can_be_datetime {
> I think any dti that has_year can become a
datetime.
> For example, DT::I->new( year=>2003
)->become_datetime->datetime
> 2003-01-01T00:00:00
Hmmm ... I think this is OK, but I'd like some way then
to control what is required.
$dti->become_datetime if
$dti->can_be_datetime('minutes')
requires:
YYYY-MM-DD HH:MM
YYYY-MM-DD HH:MM:SS
YYYY-MM-DD HH:MM:SS.NNNNNNNNN
and not
YYYY-MM-DD HH:MM:xx.NNNNNNNNN
That is, it must have years to minutes and no holes.