javascript - How to add minutes to a specific date? -
i've date:
2015-10-27 10:50:00
and in minutes variabile i've valorization: 30
add minutes date convert date in format want this:
var dbdate = moment(moment(appointment['end_datetime']).format('yyyy-mm-dd hh:mm:ss')); dbdate.add({minutes: min});
but return same date above. nb: appointment ['end_datetime'] contain date above. doing wrong?
dont format first
var dbdate = moment(appointment['end_datetime']); dbdate.add({minutes: min}); // format dbdate before using it/displaying
this assumes have value want add in minutes stored in variable min
. in code above minutes
property name, not value.
Comments
Post a Comment