Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
The format conversion xxxx-xxxx xxxx / xx / xx to the conversion code is as follows:
'Xxxx-xxxx' are each browser can not be identified, using new Date () to generate the correct date is correct usage object 'xxxx / xx / xx'.
function AdjustTime(time) {
return time.replace(/\-/g, "\/");
}
layui.util.toDateString(AdjustTime(d.FlightDateTime), 'yyyy-MM-dd')