moment.js set time on existing date is not setting the time correctly

16,128

You have to convert your moment to a Date, and assign that Date object to your end variable:

end = moment(end)
    .set({ hour: parseInt(h, 10), minute: parseInt(m, 10) })
    .toDate();
Share:
16,128
daehaai
Author by

daehaai

Updated on July 18, 2022

Comments