dgkf / parttime

Work-in-progress R package for handling partial datetimes
https://dgkf.github.io/parttime
Other
17 stars 1 forks source link

Warn when `as.parttime` loses information #22

Closed dgkf closed 2 years ago

dgkf commented 2 years ago

When parsing dates from character, warn when information is lost

For example,

as.parttime("2022-W08")

May produce anything between [2022-02-25 - 2022-03-04). Internally in the parttime object, this means that it is parsed as a NA month, since it can't be determined (in fact, any YYYY-W## will produce NA month even if the range is entirely within a month). In both cases, the missingness is broader than the input field.

Such ranges are better left to timespans, whereas parttimes should raise warnings when data is lost on conversion.