start refactoring basejumps and ziplines to just be normal challenges, make all timestamps miliseconds

This commit is contained in:
Michael Q Larson
2015-03-27 14:36:17 -07:00
parent ac8487a4fc
commit f7f7fb39b9
17 changed files with 145 additions and 295 deletions

View File

@ -199,7 +199,7 @@ module.exports = {
var date1 = new Date('10/15/2014');
var date2 = new Date();
var progressTimestamps = req.user.progressTimestamps;
var now = Date.now() / 1000 | 0;
var now = Date.now() || 0;
if (req.user.pointsNeedMigration) {
var challengesHash = req.user.challengesHash;
for (var key in challengesHash) {
@ -211,7 +211,8 @@ module.exports = {
var timeStamps = [];
R.keys(req.user.challengesHash).forEach(function(key) {
"use strict";
timeStamps.push({timeStamp: challengesHash[key]});
var timeStamp = parseInt(challengesHash[key], 10);
timeStamps.push({timeStamp: timeStamp.length !== 13 ? (+timeStamp) : (+timeStamp * 1000)});
});
req.user.completedCoursewares = Array.zip(timeStamps, coursewares,