Added custom scroll bars and separated the table header from the tables for Sales and the Graphs tables.

This commit is contained in:
Wynne Crisman
2017-10-08 08:56:15 -07:00
parent 210517a5c2
commit b5ac9fd249
44 changed files with 4939 additions and 245 deletions

View File

@@ -100,7 +100,7 @@ if(!Array.prototype.partialSort) {
sorted.sort(compareFunction);
//Put the sorted array elements back into the array.
for(let i = index, j = 0; i <= length; i++, j++) {
for(let i = index, j = 0; j < length; i++, j++) {
this[i] = sorted[j];
}
}

View File

@@ -6,4 +6,35 @@ Date.prototype.toDateInputValue = (function() {
let local = new Date(this);
local.setMinutes(this.getMinutes() - this.getTimezoneOffset());
return local.toJSON().slice(0,10);
});
});
Date.prototype.getWeek = function() {
let dowOffset = 1; // I am fixing this to indicate that the first day of the week is always Monday (weeks end on Sunday), for this application. This was a parameter in the original code.
//dowOffset = typeof(dowOffset) == 'number' ? dowOffset : 0; //default dowOffset to zero - This should check to ensure that dowOffset is between 0..6
let newYear = new Date(this.getFullYear(),0,1);
let day = newYear.getDay() - dowOffset; //the day of week the year begins on
day = (day >= 0 ? day : day + 7);
// The number of days from the beginning of the year to this.day
let daynum = Math.floor((this.getTime() - newYear.getTime() - (this.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1;
let weeknum;
// I have removed the mid-week starting cutoff detection because in this app we always want to start with week #1 (never have a week zero).
//if(day < 4) { //if the year starts before the middle of a week
weeknum = Math.floor((daynum + day - 1) / 7) + 1;
// I have turned off the detection of whether the last days of the year belong to this year's last week or next year's first week. This gets too confusing and does not result in any additional usefulness.
//if(weeknum > 52) {
// nYear = new Date(this.getFullYear() + 1, 0, 1);
// nday = nYear.getDay() - dowOffset;
// nday = nday >= 0 ? nday : nday + 7;
// // if the next year starts before the middle of the week, it is week #1 of that year
// weeknum = nday < 4 ? 1 : 53;
//}
//}
//else {
// weeknum = Math.floor((daynum+day-1)/7);
//}
return weeknum;
};