I was trying to round the moment.js time object to next nearest 30 minute interval. But looks my logic us wrong.
Ex:
10:13am -> 10:30am
11:45am -> 12:00pm
Here is my current code
start = moment();
minuteReminder = start.minute() % 30;
start.add(minuteReminder, 'minutes');
start.format("D YYYY, h:mm:ss a");
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…