scheduler-node-models 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -463,7 +463,7 @@ class Employee {
|
|
|
463
463
|
* @param date The date object used for comparison
|
|
464
464
|
* @returns A workday object or undefined for the employee's workday on the date.
|
|
465
465
|
*/
|
|
466
|
-
getWorkdayWOLeaves(date) {
|
|
466
|
+
getWorkdayWOLeaves(date, useWork) {
|
|
467
467
|
let wday;
|
|
468
468
|
let stdWorkday = 8.0;
|
|
469
469
|
let work = 0.0;
|
|
@@ -511,7 +511,7 @@ class Employee {
|
|
|
511
511
|
wday.hours = work;
|
|
512
512
|
return wday;
|
|
513
513
|
}
|
|
514
|
-
if (date.getTime() <= lastWorked.getTime()) {
|
|
514
|
+
if (useWork && date.getTime() <= lastWorked.getTime()) {
|
|
515
515
|
wday = undefined;
|
|
516
516
|
}
|
|
517
517
|
return wday;
|
|
@@ -676,6 +676,12 @@ class Employee {
|
|
|
676
676
|
end = new Date(Date.UTC(end.getFullYear(), end.getMonth(), end.getDate()));
|
|
677
677
|
while (start.getTime() <= end.getTime()) {
|
|
678
678
|
const wd = this.getWorkdayWOLeaves(start);
|
|
679
|
+
if (this.name.lastname.toLowerCase() === 'erne') {
|
|
680
|
+
const now = new Date();
|
|
681
|
+
if (start.getTime() < now.getTime()) {
|
|
682
|
+
console.log(JSON.stringify(wd));
|
|
683
|
+
}
|
|
684
|
+
}
|
|
679
685
|
if (wd) {
|
|
680
686
|
const label = `${wd.workcenter}-${wd.code}`;
|
|
681
687
|
if (label !== '-') {
|