Sorts work by date
This commit is contained in:
parent
415a621f6c
commit
60dfa22485
@ -32,8 +32,14 @@
|
||||
</div>
|
||||
</div>
|
||||
{{#if myClasses}}
|
||||
<div id="classFilterHolder">
|
||||
<h3>Filters</h3>
|
||||
{{#each types}}
|
||||
{{> sideTypeFilter}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div id="classListHolder">
|
||||
<h3>Enrolled</h3>
|
||||
<h3>By Class </h3>
|
||||
{{#if calCreWork}}
|
||||
<h3 id="calCreWork">-- Pick a class</h3>
|
||||
{{else}}
|
||||
@ -46,13 +52,6 @@
|
||||
{{> sidebarClasses}}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="classFilterHolder">
|
||||
<h3>Filters</h3>
|
||||
{{#each types}}
|
||||
{{> sideTypeFilter}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
@ -136,8 +136,8 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
|
||||
found.mine = false;
|
||||
}
|
||||
}
|
||||
if (classDisp.indexOf(courses[i]) !== -1) found.selected = true; // Filter selected.
|
||||
array.push(found);
|
||||
if (classDisp.indexOf(courses[i]) !== -1) found.selected = true; // Filter selected.
|
||||
array.push(found);
|
||||
|
||||
var thisWork = work.find({
|
||||
class: courses[i]
|
||||
@ -176,6 +176,7 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
|
||||
for (j = 0; j < thisWork.length; j++) {
|
||||
thisWork[j].classid = courses[i];
|
||||
thisWork[j].realDate = thisWork[j].dueDate;
|
||||
thisWork[j].numberDate = Date.parse(thisWork[j].realDate);
|
||||
thisWork[j].dueDate = moment(thisWork[j].dueDate).calendar(null, {
|
||||
sameDay: '[Today]',
|
||||
nextDay: '[Tomorrow]',
|
||||
@ -212,7 +213,9 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
|
||||
thisWork[j].doneRatio = "#FF1A1A";
|
||||
}
|
||||
}
|
||||
array[i].thisClassWork = thisWork;
|
||||
array[i].thisClassWork = thisWork.sort(function(a, b) {
|
||||
return parseFloat(a.numberDate) - parseFloat(b.numberDate);
|
||||
});
|
||||
}
|
||||
Session.set("noclass", false);
|
||||
Session.set("calendarClasses", array);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user