I am using moment.js in Parse cloud code, I need to get an object by tomorrow's date. I am trying to use momentjs to get the day range.
function getTommorowSongQuery()
{
var query = new Parse.Query("Song");
var tommorow = moment().add(1, 'days');
var start = moment(tommorow).startOf('day');
var end = moment(tommorow).endOf('day');
console.log('start = ' + start.toDate() + ' end = ' + end.toDate());
query.greaterThanOrEqualTo("pushDate", start.toDate());
query.lessThan("pushDate", end.toDate());
return query;
}
The problem is that I get the current date (Today) while I expect to get tomorrow.
Any Idea what am I doing wrong.