Skip to content

Commit

Permalink
Fixed Setting Seconds for Course Timings
Browse files Browse the repository at this point in the history
* Setting Seconds
* Version 0.13.44
  • Loading branch information
aneesh-neelam committed Feb 28, 2015
1 parent 1edf604 commit a92d3b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
29 changes: 14 additions & 15 deletions api/scraper/timetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,62 +164,61 @@ exports.scrapeTimetable = function (app, data, callback) {
var morningStartHour = 8;
momentTimezone.tz.setDefault("Asia/Kolkata");
var time = new momentTimezone();
time.setSeconds(0);
column = column - 1;
if (isTheory) {
if (isEndTime) {
time.set({minute: 50});
time.set({minute: 50, second: 0});
}
else {
time.set({minute: 0});
time.set({minute: 0, second: 0});
}
if (column < 12) {
time.set({hour: morningStartHour + column});
time.set({hour: morningStartHour + column, second: 0});
}
else {
time.set({hour: morningStartHour + column - 1});
time.set({hour: morningStartHour + column - 1, second: 0});
}
}
else {
if (column < 12 && (column % 6) < 4) {
if (isEndTime) {
time.set({hour: morningStartHour + column, minute: 50});
time.set({hour: morningStartHour + column, minute: 50, second: 0});
}
else {
time.set({hour: morningStartHour + column, minute: 0});
time.set({hour: morningStartHour + column, minute: 0, second: 0});
}
}
else if (column == 12) {
if (isEndTime) {
time.set({hour: morningStartHour + column, minute: 20});
time.set({hour: morningStartHour + column, minute: 20, second: 0});
}
else {
time.set({hour: morningStartHour + column - 1, minute: 30});
time.set({hour: morningStartHour + column - 1, minute: 30, second: 0});
}
}
else if (column == 13) {
if (isEndTime) {
time.set({hour: morningStartHour + column, minute: 10});
time.set({hour: morningStartHour + column, minute: 10, second: 0});
}
else {
time.set({hour: morningStartHour + column - 1, minute: 20});
time.set({hour: morningStartHour + column - 1, minute: 20, second: 0});
}
}
else {
if (isEndTime) {
if ((column % 6) === 5) {
time.set({hour: morningStartHour + column, minute: 30});
time.set({hour: morningStartHour + column, minute: 30, second: 0});
}
else {
time.set({hour: morningStartHour + column, minute: 40});
time.set({hour: morningStartHour + column, minute: 40, second: 0});
}
}
else {
if ((column % 6) === 4) {
time.set({hour: morningStartHour + column - 1, minute: 50});
time.set({hour: morningStartHour + column - 1, minute: 50, second: 0});
}
else {
time.set({hour: morningStartHour + column - 1, minute: 40});
time.set({hour: morningStartHour + column - 1, minute: 40, second: 0});
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "VITacademics",
"version": "0.13.43",
"version": "0.13.44",
"description": "VITacademics Backend and Web App",
"bugs": {
"url": "https://github.com/aneesh-neelam/VITacademics/issues",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "VITacademics",
"version": "0.13.43",
"version": "0.13.44",
"description": "VITacademics Backend and Web App",
"homepage": "https://vitacademics-dev.herokuapp.com/",
"bugs": {
Expand Down

0 comments on commit a92d3b6

Please sign in to comment.