link front and back part 1
This commit is contained in:
@ -16,15 +16,15 @@
|
||||
|
||||
|
||||
export function durationCourse(element){
|
||||
const hour = element.end.substring(3,5) -element.start.substring(3,5);
|
||||
const hour = element.lessonEnd.substring(3,5) -element.lessonStart.substring(3,5);
|
||||
|
||||
|
||||
return (element.end - element.start)%2;
|
||||
return (element.lessonEnd - element.lessonStart)%2;
|
||||
}
|
||||
|
||||
export function sortByDate(a, b) {
|
||||
const nameA = a.start; // ignore upper and lowercase
|
||||
const nameB = b.start; // ignore upper and lowercase
|
||||
const nameA = a.lessonStart; // ignore upper and lowercase
|
||||
const nameB = b.lessonStart; // ignore upper and lowercase
|
||||
|
||||
if (nameA < nameB) {
|
||||
return -1;
|
||||
@ -51,7 +51,7 @@
|
||||
}
|
||||
for(let key in list){
|
||||
const temp = list[key];
|
||||
const day = new Date(list[key].start);
|
||||
const day = new Date(list[key].lessonStart);
|
||||
if((((day.getTime()-weekStart.getTime())/60000)<10080) && (((day.getTime()-weekStart.getTime())/60000)>0)){
|
||||
matrix[day.getDay()].push(temp);
|
||||
matrix[day.getDay()].sort((a,b) => sortByDate(a,b));
|
||||
@ -75,7 +75,7 @@
|
||||
}
|
||||
for(let key in list){
|
||||
const temp = list[key];
|
||||
const day = new Date(list[key].start);
|
||||
const day = new Date(list[key].lessonStart);
|
||||
if(day.getMonth()==month){
|
||||
matrix[day.getDate()].push(temp);
|
||||
matrix[day.getDay()].sort((a,b) => sortByDate(a,b));
|
||||
@ -100,11 +100,11 @@
|
||||
|
||||
export function getMarginTop(list, index1, index2){
|
||||
if(index2 < 0){
|
||||
const temp = new Date(list[index1].start);
|
||||
const temp = new Date(list[index1].lessonStart);
|
||||
temp.setHours(8,0,0);
|
||||
return Math.abs((new Date(list[index1].start).getTime()- temp.getTime())/60000);
|
||||
return Math.abs((new Date(list[index1].lessonStart).getTime()- temp.getTime())/60000);
|
||||
}
|
||||
return Math.abs((new Date(list[index1].start).getTime()- new Date(list[index2].end).getTime())/60000)+getMarginTop(list,index2,index2-1);
|
||||
return Math.abs((new Date(list[index1].lessonStart).getTime()- new Date(list[index2].lessonEnd).getTime())/60000)+getMarginTop(list,index2,index2-1);
|
||||
}
|
||||
|
||||
export function getHoursMinutes(date){
|
||||
|
Reference in New Issue
Block a user