モデルに書き戻すためにいくつかの日付をハードコードしています。モデルを作成するときの日付の書式
など。
oEntry.StartDate = "2016-03-28T00:00:00";
これは、上の無効な日付のエラーを投げている:
oModel.create("/CalendarSet", oEntry, {
success : success,
error : error
});
日付の正しい形式は何ですか?
モデルに書き戻すためにいくつかの日付をハードコードしています。モデルを作成するときの日付の書式
など。
oEntry.StartDate = "2016-03-28T00:00:00";
これは、上の無効な日付のエラーを投げている:
oModel.create("/CalendarSet", oEntry, {
success : success,
error : error
});
日付の正しい形式は何ですか?
JavascriptのDate要素を使用できます。
oEntry = {
StartDate: new Date(year, month, day, hours, minutes, seconds, milliseconds)
};
oModel.create("/CalendarSet", oEntry, {
success : success,
error : error
});
出典:MDN
あなたはURLでSPATHのためにそれを必要とする場合は、日時文字列を取得するには、次のことができます。
getTimestamp: function getTimestamp(oDate){ //TODO: JsDoc
this.oLogger.info("Enterd function Timestamp(oDate)");
return sap.ui.core.format.DateFormat.getDateTimeInstance({pattern : "yyyy-MM-ddTKK:mm:ss"}).format(oDate || new Date());
},
これは何が必要です:
oEntry = {};
oEntry.StartDate = new Date(); // assuming "StartDate" is corr. fieldname in your service
// also assuming its the only key in your entity
// and its type DateTime
oModel.create("/CalendarSet", oEntry, {
success : success,
error : error
});
は、そのURLを見てみましょう:http://scn.sap.com/thread/3423205 – inetphantom