-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datetime): add firstDayOfWeek property (#23692)
resolves #23556 Co-authored-by: Liam DeBeasi <[email protected]>
- Loading branch information
1 parent
bc4e826
commit ea348f0
Showing
15 changed files
with
186 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
15 changes: 15 additions & 0 deletions
15
core/src/components/datetime/test/first-day-of-week/e2e.ts
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,15 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
test('first-day-of-week', async () => { | ||
const page = await newE2EPage({ | ||
url: '/src/components/datetime/test/first-day-of-week?ionic:_testing=true' | ||
}); | ||
|
||
const screenshotCompares = []; | ||
|
||
screenshotCompares.push(await page.compareScreenshot()); | ||
|
||
for (const screenshotCompare of screenshotCompares) { | ||
expect(screenshotCompare).toMatchScreenshot(); | ||
} | ||
}); |
71 changes: 71 additions & 0 deletions
71
core/src/components/datetime/test/first-day-of-week/index.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,71 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Datetime - First day of week</title> | ||
<meta name="viewport" | ||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> | ||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet"> | ||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet"> | ||
<script src="../../../../../scripts/testing/scripts.js"></script> | ||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> | ||
<style> | ||
.grid { | ||
display: grid; | ||
grid-template-columns: repeat(1, minmax(250px, 1fr)); | ||
grid-gap: 60px 20px; | ||
} | ||
h2 { | ||
font-size: 12px; | ||
font-weight: normal; | ||
|
||
color: #6f7378; | ||
|
||
margin-top: 10px; | ||
margin-left: 5px; | ||
} | ||
|
||
@media screen and (max-width: 800px) { | ||
.grid { | ||
grid-template-columns: 1fr; | ||
padding: 0; | ||
} | ||
} | ||
|
||
ion-datetime { | ||
box-shadow: 0px 16px 32px rgba(0, 0, 0, 0.25), 0px 8px 16px rgba(0, 0, 0, 0.25); | ||
border-radius: 8px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<ion-app> | ||
<ion-header translucent="true"> | ||
<ion-toolbar> | ||
<ion-title>Datetime - First day of week</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content class="ion-padding"> | ||
<div class="grid"> | ||
<div class="grid-item"> | ||
<h2>Default</h2> | ||
<ion-datetime first-day-of-week="1"></ion-datetime> | ||
<ion-button onclick="increase()">Increase firstDayOfWeek</ion-button> | ||
<div> | ||
<span>FirstDayOfWeek: <span id="start-of-week">1</span></span> | ||
</div> | ||
</div> | ||
</div> | ||
</ion-content> | ||
</ion-app> | ||
</body> | ||
<script> | ||
function increase() { | ||
const datetime = document.querySelector('ion-datetime'); | ||
datetime.firstDayOfWeek = datetime.firstDayOfWeek + 1; | ||
|
||
const span = document.getElementById('start-of-week'); | ||
span.innerText = datetime.firstDayOfWeek; | ||
} | ||
</script> | ||
</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
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