我有我的对象上的属性,我要救的日期与时间转换日期与角4,Jhipster 4.x的
public fechaActualizacion?: any,
我初始化这样的:
this.oportunidad.fechaActualizacion = new Date();
但把它变成服务给我一个错误
copy.fechaActualizacion = this.dateUtils.toDate(oportunidad.fechaActualizacion);
TODATE:
function toDate(date) {
if (date === undefined || date === null) {
return null;
}
var dateParts = date.split(/\D+/);
return new Date(dateParts[0], dateParts[1] - 1, dateParts[2], dateParts[3], dateParts[4]);
};
错误:
ERROR TypeError: t.split is not a function