I was trying to round the moment.js time object to next nearest 30 minute interval. But looks my logic us wrong. Can someone help me.
10:13am -> 10:30am
11:45am -> 12:00pm
start = moment();
minuteReminder = start.minute() % 30;
start.format("D YYYY, h:mm:ss a");
start = moment("2014/08/15 11:00"); remainder = (30 - start.minute()) % 30; moment(start).add("minutes", remainder ).format("D YYYY, h:mm:ss a");
Million ways to do this. You don't need moment.js really. Anyway, here is one.