Subject: | No way to distinguish between empty month/day and "1"? |
There doesn't seem to be a way to distinguish between:
2008
2008-01-01
I am trying to parse dates which may or may not have month/day (in bibliographies, very
common) and then I need to set individual day/month/year fields. Currently, I can't find any
DateTime::Format module which will not set day/month if they are not present, even though a
bare year is, for example, a valid ISO8601 date. DateTime::Incomplete will perhaps do this
but I can't use an object of this type as a base for DateTime::Format::Natural:
DateTime::Format::Natural->new(datetime => DateTime::Incomplete->new);
just dies with
The 'datetime' parameter ("DateTime::Incomplete=HASH(0x1028bf0a0)") to
DateTime::Format::Natural::new did not pass the 'valid object' callback ....
This inability to distinguish between an empty month/day and 01/01 is quite a problem when
splitting dates into components where the presence/absence of day/mont matters.