From 96b5ff183b70d9c2cbc2becf0f4f41a470cf63ab Mon Sep 17 00:00:00 2001 From: Dave Iverson Date: Thu, 21 Jun 2018 10:58:37 -0500 Subject: [PATCH] Modified the "days of the week" code to make the first day configurable. In OpenAir, the business is able to change the first day of the week. Previously this extension had the first day hardcoded to "Monday". In this change I add a new dropdown to the Options menu allowing the user to select the first day. It still defaults to Monday. Since loading the options is asynchronous, we can no longer rely on "getDayNum()" to return the correct day until we have loaded this setting. That means we need to delay the timesheet code that depends on this function. I've moded that code to a callback after the "firstDayOfWeek" setting is loaded. --- app/options.html | 13 +++++++++ app/scripts/openair.js | 34 ++++++++++++++++++------ app/scripts/options.js | 4 ++- app/scripts/timeentry.js | 57 ++++++++++++++++++++++++---------------- 4 files changed, 77 insertions(+), 31 deletions(-) diff --git a/app/options.html b/app/options.html index a813e31..b7d3d06 100644 --- a/app/options.html +++ b/app/options.html @@ -51,6 +51,19 @@

OpenAir Reborn Options

Choosing "Yes" will automatically save your timesheet after 15 minutes of inactivity.

+
+ + +

Select the first day of the week. This can be set by the business, and will be the first time entry column.

+