When navigating through the dates of GcalDateChooser, if we
select a day (e.g. 31) that is not contained inside the next
or previous month, Calendar crashes.
Fix that by ensuring that the selected day is always contained
in the new month.
https://gitlab.gnome.org/GNOME/gnome-calendar/issues/284
By using finalize and dispose methods and calling the proper free method.
8,806 (64 direct, 8,742 indirect) bytes in 2 blocks are definitely lost in loss record 18,051 of 18,131
at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
by 0x9A0C90E: g_malloc (gmem.c:94)
by 0x9A26A55: g_slice_alloc (gslice.c:1025)
by 0x9A26A95: g_slice_alloc0 (gslice.c:1051)
by 0x99E8DC4: g_date_time_alloc (gdatetime.c:428)
by 0x99E95C1: g_date_time_new (gdatetime.c:957)
by 0x99E97B2: g_date_time_new_local (gdatetime.c:1012)
by 0x4251F4: multi_choice_changed (gcal-date-chooser.c:419)
by 0x9567F16: g_cclosure_marshal_VOID__PARAM (gmarshal.c:1832)
by 0x95638B9: g_closure_invoke (gclosure.c:804)
by 0x957FD25: signal_emit_unlocked_R (gsignal.c:3635)
by 0x957F05C: g_signal_emit_valist (gsignal.c:3391)
https://bugzilla.gnome.org/show_bug.cgi?id=772272
Function calendar_get_week_start do the same things with the same code as
function get_first_weekday, so it is better to remove calendar_get_week_start
and switch all the use of calendar_get_week_start to get_first_weekday.
This also fixes build problems on non-glibc systems because get_first_weekday
provides fallback for non-glibc systems.
https://bugzilla.gnome.org/show_bug.cgi?id=769140
To keep the current date chooser in sync with
GNOME Shell, tweak the week names to show only
the first, upcased letter of the week name.
Also, this commit avoids making day number circles
ellipses when the week number is not present.
This is mainly a copy-paste from an old branch authored
by Matthias Clasen. The code style was updated to match
Calendar's one, and the theming was improved a little bit.