I am using moment Javascript plugin to format the date,it works in chrome but not in firefox nor Safari.
here is the code I am using:
var date = new Date(deadline.value);
alert(date); //prints out "Sat Feb 21 2015 00:00:00 GMT+0000 (GMT)"
deadline.value = moment(date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate()).format();
alert(deadline.value); //prints "Invalid date"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.