forked from Hackfmi/FMI-Data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse_programs_helper.js
52 lines (39 loc) · 1.08 KB
/
parse_programs_helper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(function() {
var getDay = function(allRows, startFromIndex, groupsInProgram) {
var dayRows = [];
var counter = 0;
allRows.each(function(index, item){
if(index >= startFromIndex && counter < groupsInProgram) {
dayRows.push(item);
counter++
}
});
return dayRows;
};
exports.extractTableData = function($, rows) {
var result = [];
$(rows).children("td").each(function(index, item){
result.push(item);
});
return result;
};
exports.monday = function(allRows) {
return getDay(allRows, 1, 5);
};
exports.tuesday = function(allRows) {
return getDay(allRows, 6, 5);
};
exports.wednesday = function(allRows) {
return getDay(allRows, 11, 5);
};
exports.thursday = function(allRows) {
return getDay(allRows, 16, 5);
};
exports.friday = function(allRows) {
// it's friday, friday, friday !
return getDay(allRows, 21, 5);
};
exports.saturday = function(allRows) {
return getDay(allRows, 26, 5);
};
})();