static void log_window_calendar_chats_day_selected_cb (GtkWidget *calendar, EmpathyLogWindow *window) { guint year; guint month; guint day; GDate *date; gtk_calendar_get_date (GTK_CALENDAR (calendar), &year, &month, &day); if (day == 0) /* No date selected */ return; /* We need this hear because it appears that the months start from 0 */ month++; date = g_date_new_dmy (day, month, year); DEBUG ("Currently selected date is: %04u-%02u-%02u", year, month, day); log_window_chats_get_messages (window, date); g_date_free (date); }
static void log_window_chats_changed_cb (GtkTreeSelection *selection, EmpathyLogWindow *window) { /* Use last date by default */ gtk_calendar_clear_marks (GTK_CALENDAR (window->calendar_chats)); log_window_chats_get_messages (window, NULL); }
static void log_window_calendar_chats_day_selected_cb (GtkWidget *calendar, EmpathyLogWindow *window) { guint year; guint month; guint day; gchar *date; gtk_calendar_get_date (GTK_CALENDAR (calendar), &year, &month, &day); /* We need this hear because it appears that the months start from 0 */ month++; date = g_strdup_printf ("%4.4d%2.2d%2.2d", year, month, day); DEBUG ("Currently selected date is:'%s'", date); log_window_chats_get_messages (window, date); g_free (date); }