I need to use DateTime::Format::ISO8601 but there is a problem I come across with DateTime in general in that it fills in missing month/days instead of leaving them undef:
use DateTime::Format::ISO8601;
my $dt = DateTime::Format::ISO8601->parse_datetime('2016');
say join(',', $dt->year, $dt->month, $dt->day);
my $dt = DateTime::Format::ISO8601->parse_datetime('2016-01-01');
say join(',', $dt->year, $dt->month, $dt->day);
Outputs:
2016,1,1
2016,1,1
If I need to know whether there was a month/day in the input, the information is lost. Of course I could parse the input date myself to find this out but this is not lazy enough when there is a module that's supposed to be doing this for me. Any comments on this? I need some of the era functionality of DT but this issue prevents me from being able to use it at the moment.