lib/parser: fix month days

In the olden days, we stored dates like e.g. 20180131121234, and do a
lexicographical check. With that, we could use e.g. upper-limits
201802312359 for "all dates in Feb 2018", even if Feb doesn't have 31
days.

However, nowadays we use time_t values, and g_date_time_new_local raises
errors for non-existent days; easiest fix is to massage things a bit; so
let's do that.

Fixes issue #1197.
This commit is contained in:
djcb
2018-02-17 17:44:21 +02:00
parent 15ba4699ab
commit 6fe67b354d
2 changed files with 42 additions and 2 deletions

View File

@ -62,6 +62,9 @@ test_date_basic ()
{ "1972-12-14T09:10:23", true, "0093165023" },
{ "1854-11-18T17:10:23", true, "0000000000" },
{ "2000-02-31T09:10:23", true, "0951861599" },
{ "2000-02-29T23:59:59", true, "0951861599" },
{ "2016", true, "1451599200" },
{ "2016", false, "1483221599" },