Modified the "days of the week" code to make the first day configurable #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 modifieded that code to a callback after the "firstDayOfWeek" setting is loaded.
I don't know Angular, especially not Angular 1. So please correct any bad Angular practices. There may be an easier way to update the $weekdays and $reverseWeekdays after we've loaded the option.
I had to update a few NPM packages to be able to run this project. I can create a separate PR with those updates.
See issue #30