I've a problem. I'm using the Datepicker like this:
<DateTimePicker id="pickerStartTime" value="{CURRENT>/StartTime}" valueLiveUpdate="true" displayFormat="dd.MM.yy HH:mm" valueFormat="yyyy-MM-dd HH:mm" />
On RouteMatched i want to display the current Date and Time.
_onRouteMatched: function(oEvent) {
this.oModelCurrent.setProperty("/", {
Name: "",
StartTime: new Date(),
Duration: "30",
ShuntReason: "",
});
}
My problem is the displayFormat. The DateTimePicker shows e.g.
Thu Apr 26 2018 11:42:00 GMT+0200 (Mitteleuropäische Sommerzeit)
and not the displayFormat dd.MM.yy HH:mm
. After selecting a Date/Time from Datepicker everything is fine.
I've tried to put the date like below in the model:
StartTime: moment().format("DD.MM.YYYY HH:mm")
But that results in a Invalid Date.