Format existing date variable with moment.js
You're using moment(String)
method, but you're not passing a Supported
format that it expects to parse.
You should use moment(String, String)
, where the first String is the input date string, and second is the format of your input date String.
Try this:
moment(date+' '+time,'DD/MM/YYYY HH:mm').format('MM.DD.YYYY');