-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
secondaryCalendarType
global config (#7547)
- Loading branch information
Showing
8 changed files
with
125 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
<title>Calendar Type Configuration</title> | ||
|
||
<script src="../../bundle.esm.js" type="module"></script> | ||
|
||
<script data-ui5-config type="application/json"> | ||
{ | ||
"calendarType": "Islamic", | ||
"secondaryCalendarType": "Gregorian" | ||
} | ||
</script> | ||
|
||
</head> | ||
|
||
<body> | ||
<section> | ||
<ui5-title> Global config: "calendarType": "Islamic", "secondaryCalendarType": "Gregorian"</ui5-title> | ||
<br><br> | ||
<ui5-date-picker></ui5-date-picker> | ||
<ui5-datetime-picker ></ui5-datetime-picker> | ||
<ui5-daterange-picker></ui5-daterange-picker> | ||
<br><br> | ||
<ui5-calendar id="cal1"></ui5-calendar> | ||
</section> | ||
|
||
<section> | ||
<br><br> | ||
<ui5-title> primary-calendar-type="Gregorian" secondary-calendar-type="Islamic"</ui5-title> | ||
<ui5-date-picker id="dp1" primary-calendar-type="Gregorian" secondary-calendar-type="Islamic"></ui5-date-picker> | ||
|
||
<br><br> | ||
<ui5-title> primary-calendar-type="Islamic" secondary-calendar-type="Gregorian"</ui5-title> | ||
<ui5-date-picker primary-calendar-type="Islamic" secondary-calendar-type="Gregorian"></ui5-date-picker> | ||
|
||
<br><br> | ||
<ui5-title> primary-calendar-type="Japanese" secondary-calendar-type="Islamic"</ui5-title> | ||
<ui5-date-picker primary-calendar-type="Japanese" secondary-calendar-type="Islamic"></ui5-date-picker> | ||
|
||
<br><br> | ||
<ui5-title> primary-calendar-type="Islamic" secondary-calendar-type="Japanese"</ui5-title> | ||
<ui5-date-picker primary-calendar-type="Islamic" secondary-calendar-type="Japanese"></ui5-date-picker> | ||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { assert } from "chai"; | ||
|
||
describe("Calendar general interaction", () => { | ||
before(async () => { | ||
await browser.url(`test/pages/CalendarConfig.html`); | ||
}); | ||
|
||
it("Calendar type configured", async () => { | ||
const calendar = await browser.$("#cal1"); | ||
|
||
// Component primaryCalendarType and secondaryCalendarType are not set | ||
assert.strictEqual(await calendar.getProperty("primaryCalendarType"), null, | ||
"Primary calendar type is not set."); | ||
assert.strictEqual(await calendar.getProperty("secondaryCalendarType"),null, | ||
"Secondary calendar type is not set."); | ||
|
||
// Configured calendar types are effectively used | ||
assert.strictEqual(await calendar.getProperty("_primaryCalendarType"), "Islamic", | ||
"Primary calendar configured."); | ||
assert.strictEqual(await calendar.getProperty("_secondaryCalendarType"), "Gregorian", | ||
"Secondary calendar configured."); | ||
}); | ||
}); |