Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/src/components/datetime/datetime.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,11 @@

/**
* Day that is selected and is today
* should have white color.
* should have base background color
* with contrast text.
*/
:host .calendar-day.calendar-day-today.calendar-day-active {
background: current-color(base);
color: current-color(contrast);
}

Expand Down
38 changes: 38 additions & 0 deletions core/src/components/datetime/test/basic/datetime.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,44 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
});
});

configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('datetime: today button rendering'), () => {
test('should render today button correctly when selected', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'FW-5808',
});
await page.setContent(
`
<ion-datetime presentation="date" value="2022-01-02"></ion-datetime>

<script>
const mockToday = '2022-01-02T16:22';
Date = class extends Date {
constructor(...args) {
if (args.length === 0) {
super(mockToday)
} else {
super(...args);
}
}
}
</script>
`,
config
);

const datetime = page.locator('ion-datetime');

await page.waitForSelector('.datetime-ready');

await expect(datetime.locator('.calendar-day-today')).toHaveScreenshot(
screenshot(`datetime-today-calendar-button`)
);
});
});
});

/**
* The calendar day highlight does not render
* on iOS and has the same behavior across directions.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.