on ‎2021 Feb 27 1:22 AM
I want to show the date I got with DatePicker in a section in a table. But the date is missing 1 day.


I tried many methods:
https://answers.sap.com/questions/409976/sap-webide---ui5---date-field-is-not-showing-corre.html
https://answers.sap.com/questions/323063/date-value-is-getting-reduced-by-one-day-while-pas.html
But it didn't work. What is your suggestion?
Request clarification before answering.
I am assuming your table is directly binded to odata model
<Table items="{/ListSet}">
Can you confirm
if data save at backend for 5th date ?
if not then issue when you passing data to backend at time only you missing one day.
var vTarih = sap.ui.getCore().byId("dpKayitTarih").getDateValue();To Solve this you need to do as below
resolveTimeDifference:function(dateTime){
if (dateTime !== undefined && dateTime !== null && dateTime !== "") {
var offSet = dateTime.getTimezoneOffset();
var offSetVal = dateTime.getTimezoneOffset() / 60;
var h = Math.floor(Math.abs(offSetVal));
var m = Math.floor((Math.abs(offSetVal) * 60) % 60);
dateTime = new Date(dateTime.setHours(h, m, 0, 0)); return dateTime;
}
return null;
},
var vTarih = this.resolveTimeDifference(sap.ui.getCore().byId("dpKayitTarih").getDateValue());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are great. Thank you so much. Problem solved.
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.