Skip to content

Commit

Permalink
docs: document calendarType usage (#2812)
Browse files Browse the repository at this point in the history
When the users read the DatePicker/Calendar API reference it does not clear how to use different calendar types - Buddhist, Japanese, etc.
FIXES: #2792
  • Loading branch information
ilhan007 authored Feb 15, 2021
1 parent c0969aa commit 23ff62d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/main/src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,30 @@ const metadata = {
* </ul>
* <br>
*
* <h3>Calendar types</h3>
* The component supports several calendar types - Gregorian, Buddhist, Islamic, Japanese and Persian.
* By default the Gregorian Calendar is used. In order to use the Buddhist, Islamic, Japanese or Persian calendar,
* you need to set the <code>primaryCalendarType</code> property and import one or more of the following modules:
* <br><br>
*
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Buddhist.js";</code>
* <br>
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Islamic.js";</code>
* <br>
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Japanese.js";</code>
* <br>
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Persian.js";</code>
* <br><br>
*
* Or, you can use the global configuration and set the <code>calendarType</code> key:
* <br>
* <pre><code>&lt;script data-id="sap-ui-config" type="application/json"&gt;
* {
* "calendarType": "Japanese"
* }
* &lt;/script&gt;
*
*
* <h3>ES6 Module Import</h3>
*
* <code>import "@ui5/webcomponents/dist/Calendar";</code>
Expand Down
23 changes: 23 additions & 0 deletions packages/main/src/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,29 @@ const metadata = {
* <li>[SHIFT] + [CTRL] + [PAGEUP] - Increments the corresponding year by one</li>
* </ul>
*
* <h3>Calendar types</h3>
* The component supports several calendar types - Gregorian, Buddhist, Islamic, Japanese and Persian.
* By default the Gregorian Calendar is used. In order to use the Buddhist, Islamic, Japanese or Persian calendar,
* you need to set the <code>primaryCalendarType</code> property and import one or more of the following modules:
* <br><br>
*
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Buddhist.js";</code>
* <br>
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Islamic.js";</code>
* <br>
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Japanese.js";</code>
* <br>
* <code>import "@ui5/webcomponents-localization/dist/features/calendar/Persian.js";</code>
* <br><br>
*
* Or, you can use the global configuration and set the <code>calendarType</code> key:
* <br>
* <pre><code>&lt;script data-id="sap-ui-config" type="application/json"&gt;
* {
* "calendarType": "Japanese"
* }
* &lt;/script&gt;
*
* <h3>ES6 Module Import</h3>
*
* <code>import "@ui5/webcomponents/dist/DatePicker";</code>
Expand Down

0 comments on commit 23ff62d

Please sign in to comment.