datetime: Do date validation inside constructors instead of asserting and having user code deal with it
The following discussion from !678 (merged) should be addressed:
-
@slomo started a discussion: (+7 comments) All the constructors can fail in certain situations. And IMHO we should also make the constraints for the years/etc normal errors instead of
g_return_val_if_fail()
. @tpm ?
See more discussion over there. In short: we already do the checks anyway and date handling code is difficult and we should let user code worry about that. For some validation errors we already return NULL
gracefully, for others we assert. Goal is to return NULL
gracefully in general and document that this is the case since 1.20.