-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work for timesheet weeks that start on Sunday, rather than Monday #30
Comments
That was such a passionate plea, how can I say no? Can you please send me a On Wed, Jan 21, 2015, 7:23 PM Alex [email protected] wrote:
|
Thank you SOOOOO MUCH, you have no idea what this will mean to me, and everyone else that has to deal with OA at my company. Total lifesaver. I've e-mailed you directly with the requested resources. Please let me know if you need anything else. Eternally grateful, -Alex |
Hey Alex, haven't gotten it yet, did you send to [email protected] ? On Mon Jan 26 2015 at 10:31:34 AM Alex [email protected] wrote:
|
Zip hosted and link e-mailed. Thanks. |
Got it! On Mon Jan 26 2015 at 10:55:45 AM Alex [email protected] wrote:
|
Hey buddy, checking in on this - I'm desperate. Can I place a bounty on this feature? Shall we start the bribing at, say - $25.00? |
Wow, I really screwed the pooch on this one. I spent some time with it tonight, and it's proving to be near impossible for me to fix this in a way that I can be sure that it's fixed without being able to set it up so that Sunday is the first day on my end. I tried dropping in the markup that you sent and that didn't do it because OpenAir does a lot of wild stuff on page load before I can get to it. That said, it seems like some combination of altering the following is the fix:
Sorry I couldn't be more helpful here. I'll leave this open in case anyone else wants to come along and help out. |
I'm late to this party/discussion, but just came across this extension in trying to make my timekeeping life a little less hellish. I love this extension, but was having the same issue as other users here since our work week is configured to start on Saturdays, so all entries are two days off when saving. I think I have found a simple fix for this, so wanted to make a suggestion. As mentioned above, in OpenAir.js, there is a function at line 391 - GetDayNum. I was able to get my situation to work flawlessly by simply modifying the order of the array defined in this function so that Saturday is index 0, Sunday index 1, and so on: /**
* Helper function to convert two digit day code to integer.
*
* @TODO: Start using numbers instead of day codes. It'll remove a lot of dumb logic.
*
* @param {string} dayCode
* @returns {int}
*/
this.getDayNum = function(dayCode) {
var weekdays = [];
weekdays.sa = 0;
weekdays.su = 1;
weekdays.mo = 2;
weekdays.tu = 3;
weekdays.we = 4;
weekdays.th = 5;
weekdays.fr = 6;
return weekdays[dayCode];
}; To make this universally configurable, it would be good to have a new setup item on the Options page to specify your OpenAir weekday order, or just starting day of the week. Then this function would properly order the array based on that input for a given OA schedule. I'm a hack who is good at reading code and making small modifications, but not necessarily wholesale changes like this, so I am not going to branch this change myself, but wanted to make the suggestion for others who are more capable to implement. |
If anyone is still using this extension, would you mind checking out PR #37 to see if this solves your problem? |
I love this freaking extension, really, truly, honestly, I do, but I am going to kick babies if this thing screws up my entries again.
Just for kicks, I checked out what day 7/14/2014 was (from the extension screenshot) and sure enough, it was Monday.
I can't get my company to change the way the weeks are in OA, and try as I might, I cannot figure out how to fix it in the code. I've looked at every last file, poured over every last detail, and it still eludes me.
PLEASE fix this so that it's flexible about the week starting day. I will buy you beer, I will bring you hookers and blackjack. Just help me.
The text was updated successfully, but these errors were encountered: