Use ISO date/time in csv export
CSV is a machine readable format, but localized date/times complicate parsing. I was trying to write a python3 script to parse the CSV output but since python's datetime doesn't parse unknown date formats this would be impossible without using a 3rd party python library.
Hmmm, I could set LC_TIME=C
to have a consistent date format to parse, but future users might benefit from ISO dates.
I've no idea if this patch will break other software using konsolekalendar
, as they might be using the LC_TIME=C
too.
$ LC_TIME=C konsolekalendar --export-type csv 2>/dev/null
"Wednesday, July 29, 2020","","Wednesday, July 29, 2020","","test allday","Default location","","fea4c06b-f818-47b1-bbfe-0dc3eae9dbfb"
"Wednesday, July 29, 2020","8:00:00 AM EDT","Wednesday, July 29, 2020","9:00:00 AM EDT","test time","Default location","description","f605a223-b27f-4049-95bf-20b2deea67d4"
- https://github.com/KDE/akonadi-calendar-tools/blame/master/konsolekalendar/konsolekalendarexports.cpp#L223
- https://github.com/KDE/kcalendarcore/blob/master/src/event.h
- https://doc.qt.io/qt-5/qdate.html#toString-1
- https://doc.qt.io/qt-5/qtime.html#toString-1
If Merged TODO:
Before:
$ LC_TIME=fr_FR.UTF-8 konsolekalendar --export-type csv 2>/dev/null
"mercredi 29 juillet 2020","","mercredi 29 juillet 2020","","test allday","Default location","","fea4c06b-f818-47b1-bbfe-0dc3eae9dbfb"
"mercredi 29 juillet 2020","08:00:00 EDT","mercredi 29 juillet 2020","09:00:00 EDT","test time","Default location","description","f605a223-b27f-4049-95bf-20b2deea67d4"
After:
$ LC_TIME=fr_FR.UTF-8 konsolekalendar --export-type csv 2>/dev/null
"2020-07-29","","2020-07-29","","test allday","Default location","","fea4c06b-f818-47b1-bbfe-0dc3eae9dbfb"
"2020-07-29","08:00:00","2020-07-29","09:00:00","test time","Default location","description","f605a223-b27f-4049-95bf-20b2deea67d4"