core: Get week start day from GcalContext

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
This commit is contained in:
mindonwarp
2026-09-26 17:21:59 +00:00
committed by Marge Bot
parent c874bde622
commit 059d72499f
2 changed files with 26 additions and 0 deletions
+23
View File
@@ -509,6 +509,29 @@ gcal_context_get_time_format (GcalContext *self)
return self->time_format;
}
/**
* gcal_context_get_week_start_day:
* @self: a #GcalContext instance
*
* Retrieves the current value of "week-start-day" desktop setting.
* Note that this value is synced with the source setting through
* the appropriate portal and if you want to be notified of changes
* you should register a callback on #GcalContext:week-start-day property.
*
* When the desktop setting is set to 'G_DESKTOP_WEEKDAY_DEFAULT'
* we fall back to 'get_first_weekday_iso()' function from 'gcal-utils.h'
* to find the actual day of the week from current locale.
*
* Returns: the currently set #GDesktopWeekday value
*/
GDesktopWeekday
gcal_context_get_week_start_day (GcalContext *self)
{
g_return_val_if_fail (GCAL_IS_CONTEXT (self), get_first_weekday ());
return self->week_start_day;
}
/**
* gcal_context_get_timezone:
*