Browse files

fixing time issue with api data and displaying data

  • Loading branch information...
1 parent ebe023b commit f5f71ec9d0b6c82df91cd2c0c9da405957d125cf @michelleboisson committed Jun 6, 2012
Showing with 5 additions and 5 deletions.
  1. +4 −4 getNewData.js
  2. +1 −1 views/single-event.html
View
8 getNewData.js
@@ -95,15 +95,15 @@ db.startup(process.env.MONGOLAB_URI); // start the db connection
console.log("from JSON, end time: "+ String(element.eventEndTime));
console.log("1");
- //var translatedStartTime = moment(thisStartTime, "h:m a");
- var translatedStartTime = moment(thisStartTime, "h:m a").add('hours',4);
+ var translatedStartTime = moment(thisStartTime, "h:m a");
+ //var translatedStartTime = moment(thisStartTime, "h:m a").add('hours',4);
console.log("start time "+ translatedStartTime.hours());
console.log("2");
console.log("thisStartTime: " + thisStartTime);
console.log("thisEndTime: " + thisEndTime);
- //var translatedEndTime = moment(thisEndTime, "h:m a");
- var translatedEndTime = moment(thisEndTime, "h:m a").add('hours',4);
+ var translatedEndTime = moment(thisEndTime, "h:m a");
+ //var translatedEndTime = moment(thisEndTime, "h:m a").add('hours',4);
console.log("end time "+ translatedEndTime.hours());
if (translatedEndTime.hours() == 0){
translatedEndTime = moment(translatedStartTime).add('hours', 2); //add 2 hours by default
View
2 views/single-event.html
@@ -52,7 +52,7 @@
var startTime = $("#datetime").html();
var endtime = $("#endtime").html();
- $("#datetime").html(moment(new Date(startTime)).calendar() +" - "+moment(new Date(endtime)).format("h:mm a"));
+ $("#datetime").html(moment(new Date(startTime)).utc().calendar() +" - "+moment(new Date(endtime)).utc().format("h:mm a"));
$("#endtime").remove();
});

0 comments on commit f5f71ec

Please sign in to comment.