Page 1 of 1

how to determine total hours

Posted: Mon Mar 21, 2016 9:26 pm
by joshsard
hi again :)

just a simple question, below is a screenshot of a sample weekly sched:
weekly_sched.JPG
how do i "get" the "total" number of hours scheduled for all of the dates shown in this current week?
i look at the codes particularly ScheduleFactory.php and ScheduleViewController.js,
but it seems like I could only get the start/end/total time per singular day (the one I'm editing or adding via New button)

any help would greatly be appreciated

Re: how to determine total hours

Posted: Tue Mar 22, 2016 7:13 am
by shaunw
That is correct, you will need to add up the total time for each day in the period that you want a total for.

Re: how to determine total hours

Posted: Tue Mar 22, 2016 6:18 pm
by joshsard
yeah, but i cant seem to find in the code where it cycles through all the days shown currently, and if its has a schedule (cell with value) or not (blank cell). i'm wishing you could help me in at least where it does this, thank you so much

Re: how to determine total hours

Posted: Tue Mar 22, 2016 8:50 pm
by joshsard
i found something in the javascript file ScheduleViewController.js, when I do this
alert("week start: " + this.start_date.format());
alert("week end: " + this.end_date.format());

i get the monday and sunday date (start and end of the shown row),
but i would like these values to be acquired through the php class file,
particularly in ScheduleFactory.class.php inside the Validate function, how do I that?

i will use those dates to call the method "getByUserIdAndStartDateAndEndDate" of ScheduleListFactory to count the # of records, so i could get each scheduled day, then maybe each total hour and calculate the grand total hour