GNOME Bugzilla – Bug 409200
time_from_isodate() does not read ISO8601 dates
Last modified: 2021-05-19 11:04:04 UTC
The current format read by this function is yyyymmdd[Thhmmss[Z]]. This is wrong since the standard is yyyymmdd[Thh:mm:ss[Z]], and there's some timezone information. glib 2.12 has g_time_val_from_iso8601() which should work as expected.
Note that this is breaking the evolution/clock applet integration. Would be great to fix this for 2.20.
Just to clarify -- what I am seeing is that this command line: #evolution calendar:///?startdate=20070830 just hangs forever and the calendar window never opens. Is that the same problem you are reporting?
I don't think that's not the same problem.
Please, can we get this fixed? It's bad to have apps that will use hhmmss instead of hh:mm:ss since this means it will break in the future.
Created attachment 268530 [details] [review] Updated time_from_isodate() to read ISO8601 dates also Please review the patch
Review of attachment 268530 [details] [review]: Thanks for a patch. Apart of coding-style issues highlighted below, I see more issues with the patch: a) the added strcpy() call can easily overflow buffer of 20 characters b) your added code simply strips ':' from the string, which is not the same as supporting the ISO format, because you would also accept malformed strings like "20140220T1:22222", which is none of the supported formats ::: calendar/libecal/e-cal-time-util.c @@ +620,3 @@ + /* iso_str = yyyymmdd[Thh:mm:ss[Z]] */ + + if (strchr(iso_str, ':')) { coding-style: missing space after 'strchr' @@ +628,3 @@ + str[j] = 0; + } + else coding-style: else belongs on the same line as the closing bracket
*** Bug 349770 has been marked as a duplicate of this bug. ***
According to [1], the time can be with and without ':'. And the seconds cannot be skipped (that's for bug #349770). From my point of view, the naming of the function is not ideal. It's rather meant to be able to read what isodate_from_time_t() produces. It doesn't conform with iso date/time generated by libical functions, to name one. The g_time_val_from_iso8601() also doesn't cover whole ISO 8601. I tend to WontFix this. [1] http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/ Thank you for your understanding and your help.