[gnome-calendar/gnome-41] application: Fix tm -> GDateTime year conversion



commit 29ffb926961ed18fe5bc1486d83c87ea6a838fce
Author: Michael Webster <miketwebster gmail com>
Date:   Fri Dec 10 14:07:07 2021 -0500

    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

 src/gui/gcal-application.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/gui/gcal-application.c b/src/gui/gcal-application.c
index a541bb4b..5d680723 100644
--- a/src/gui/gcal-application.c
+++ b/src/gui/gcal-application.c
@@ -412,7 +412,7 @@ gcal_application_command_line (GApplication            *app,
           g_autoptr (GDateTime) initial_date = NULL;
 
           initial_date = g_date_time_new (gcal_context_get_timezone (self->context),
-                                          result.tm_year,
+                                          result.tm_year + 1900,
                                           result.tm_mon,
                                           result.tm_mday,
                                           result.tm_hour,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]