on 01-17-2021 5:10 PM
Hello experts,
The islamic calendar customization is mentioned in the following note:
https://i7p.wdf.sap.corp/sap/support/notes/2852821
I know SAPGUI calendar at backend support this.
I am trying to figure out if UI5 date picker support this.
So far I only found some info about Fiori Launchpad without a working example:
//Configuring Mapping Data for the Islamic Calendar https://help.sap.com/viewer/a7b390faab1140c087b8926571e942b7/1709%20000/en-US/0cde136ff59344a48c668b...
Thanks in advance.
Zhi Ning Liu
I figure this out myself with help of some ui5 experts.
For fiori app, it has built in support. Check note below:
https://launchpad.support.sap.com/#/notes/2159822
in case you are not using a fiori app, you need to set it up before instantiating your date picker object, something like below. It is not readable, so you need to open it as html file.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>Calendar - sap.ui.unified</title> <script id="sap-ui-bootstrap" data-sap-ui-theme="sap_fiori_3" data-sap-ui-language="en" data-sap-ui-libs="sap.ui.unified, sap.m" src="/sapui5/resources/sap-ui-core.js" > </script> <script> var oConfiguration = sap.ui.getCore().getConfiguration() varoFormatSettings = oConfiguration.getFormatSettings(); /* // the data should look like this var aData = [{ "dateFormat": "A", "islamicMonthStart": "14351201", "gregDate": "20140925" }, { "dateFormat": "A", "islamicMonthStart": "14360101", "gregDate": "20141024" }, { "dateFormat": "A", "islamicMonthStart": "14360201", "gregDate": "20141123" }]; oFormatSettings.setLegacyDateCalendarCustomizing(aData); */ oConfiguration.applySettings({ calendarType: sap.ui.core.CalendarType.Islamic, formatSettings: oFormatSettings }); sap.ui.getCore().applyChanges(); // DatePicker example new sap.m.DatePicker({ dateValue: new Date(2014, 8, 25) }).placeAt("content"); </script> </head> <body> <div id="content" style="padding-top:50px;"></div> </body> </html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have experience with islamic calendar type, so not sure if this is what you are looking for. But DatePicker (and other controls) support islamic Calendar Format. See e.g.
https://sapui5.hana.ondemand.com/#/entity/sap.m.DatePicker/sample/sap.m.sample.DatePicker
There is no date picker preconfigured for Islamic Calendar Type in this sample, but you can easily do that in console:
sap.ui.getCore().byId("__xmlview11--DP7").setDisplayFormatType(sap.ui.core.CalendarType.Islamic)
This way, you get one that looks like that:
Hope, that helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sergei,
Thanks a lot for the info. I have tried to play with instantiating sap.m.DatePicker in our application. As you mentioned, I also had to set calendar type for the date picker object. For example, I have code like below
var dp = null;
dp = new sap.m.DatePicker( dpIdValid );
dp.setDisplayFormatType( this.getCalendarType() );
dp.setValueFormat( dfmt );
<setting more attributes of dp object>
var ctnId = ipId + "_ui5dpctr";
dp.placeAt( ctnId );
My question is that when we choose islamic calendar type, will it support content in table TISLCAL ?
To my knowledge, SAPGUI calendar is supporting this.
If you login to any ABAP system, and change user defaults with tcode SU3,
Once that is changed and saved, you can find a SAPGUI calendar instance at menu
System > Services > Jobs > Job Overview
This calendar is respecting customization data stored in table TISLCAL.
My question is if UI5 supports the same. Actually we are working on an incident from a customer who requested that the month starting date should be adjustable.
Thanks a lot again for your response.
Zhi Ning
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.