diff --git a/src/Context.cpp b/src/Context.cpp index 3ca9e6c2c..2ba1352fb 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -1105,6 +1105,11 @@ void Context::staticInitialization() { Task::regex = Variant::searchUsingRegex = config.getBoolean("regex"); Lexer::dateFormat = Variant::dateFormat = config.get("dateformat"); + auto weekStart = Datetime::dayOfWeek(config.get("weekstart")); + if (weekStart != 0 && weekStart != 1) + throw std::string( + "The 'weekstart' configuration variable may only contain 'Sunday' or 'Monday'."); + Datetime::weekstart = weekStart; Datetime::isoEnabled = config.getBoolean("date.iso"); Datetime::standaloneDateEnabled = false; Datetime::standaloneTimeEnabled = false; diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index 3fae4394d..88129a44f 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -404,12 +404,7 @@ int CmdCalendar::execute(std::string& output) { std::string CmdCalendar::renderMonths(int firstMonth, int firstYear, const Datetime& today, std::vector& all, int monthsPerLine) { auto& config = Context::getContext().config; - - // What day of the week does the user consider the first? - auto weekStart = Datetime::dayOfWeek(config.get("weekstart")); - if (weekStart != 0 && weekStart != 1) - throw std::string( - "The 'weekstart' configuration variable may only contain 'Sunday' or 'Monday'."); + auto weekStart = Datetime::weekstart; // Build table for the number of months to be displayed. Table view; diff --git a/src/libshared b/src/libshared index 47c3262fa..e0d493d16 160000 --- a/src/libshared +++ b/src/libshared @@ -1 +1 @@ -Subproject commit 47c3262fa97c4b69542040d39be6c516c38d0e57 +Subproject commit e0d493d16357d14f0f6092c6670777cde8eca76c