I currently have a client-side date picker. After selecting a date, the date in milliseconds is sent to my node application. the problem is that I get an invalid date for the new date (milliseconds)
milliseconds sent look like (1347433200000) my code is like vapor
app.get('/dashboard/date/:date', function(req, res){ console.log(new Date(req.params.date)); var start = new Date(req.params.date); var end = new Date(req.params.date).add({hours:23, minutes:59, seconds: 59, milliseconds: 999}); console.log(start); console.log(end); Appointments.find({'scheduled' : {"$gte": start, "$lt": end}}, function(err, list){ res.render('templates/list',{ layout: false, appointments: list }); }); });
source share