application: Fix tm -> GDateTime year conversion

g_date_time_new() expects an actual year, while the tm struct
only provides the number of years since 1900.

ref:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/time.h.html
This commit is contained in:
Michael Webster
2021-12-10 14:20:13 -05:00
parent 2697dac460
commit a0aa36b6d2
+1 -1
View File
@@ -412,7 +412,7 @@ gcal_application_command_line (GApplication *app,
g_autoptr (GDateTime) initial_date = NULL; g_autoptr (GDateTime) initial_date = NULL;
initial_date = g_date_time_new (gcal_context_get_timezone (self->context), initial_date = g_date_time_new (gcal_context_get_timezone (self->context),
result.tm_year, result.tm_year + 1900,
result.tm_mon, result.tm_mon,
result.tm_mday, result.tm_mday,
result.tm_hour, result.tm_hour,