From a92d3b62288211af93e503842ba832f04496198b Mon Sep 17 00:00:00 2001 From: aneesh-neelam Date: Sat, 28 Feb 2015 16:31:44 +0530 Subject: [PATCH] Fixed Setting Seconds for Course Timings * Setting Seconds * Version 0.13.44 --- api/scraper/timetable.js | 29 ++++++++++++++--------------- bower.json | 2 +- package.json | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/api/scraper/timetable.js b/api/scraper/timetable.js index 030a25e..f9c4244 100644 --- a/api/scraper/timetable.js +++ b/api/scraper/timetable.js @@ -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}); } } } diff --git a/bower.json b/bower.json index 00d1726..3877a5c 100644 --- a/bower.json +++ b/bower.json @@ -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", diff --git a/package.json b/package.json index 54c9637..9c69a22 100644 --- a/package.json +++ b/package.json @@ -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": {