on 2025 Apr 07 7:37 AM
HI Team,
I am Working on one requirement, but here in sap ui5 planning calendar control appointment is showing one day before.
Please let me know how to resolve this error.
Regards,
Preeti
Request clarification before answering.
Hello preeti_anandkar,
The SAPUI5 Planning Calendar showing appointments one day before is usually due to timezone differences.
Here's the simple fix:
API Reference: https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.core.format.DateFormat
Formatter Sample:
sap.ui.define([
"sap/ui/core/format/DateFormat"
], function (DateFormat) {
"use strict";
return {
formatUTCDateToLocal: function (oUTCDate) {
if (!oUTCDate) {
return null;
}
var oDateFormat = DateFormat.getDateTimeInstance({ pattern: "yyyy-MM-dd HH:mm" });
return oDateFormat.format(oUTCDate);
}
};
});XML Binding:
<PlanningCalendarRow
startDate="{
path: 'StartDate',
formatter: '.formatter.formatUTCDateToLocal'
}"
endDate="{
path: 'EndDate',
formatter: '.formatter.formatUTCDateToLocal'
}">
</PlanningCalendarRow>Regards,
Farooq
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 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.