Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datetime): add showAdjacentDays to display days from the previous and next months #30209

Open
wants to merge 37 commits into
base: feature-8.5
Choose a base branch
from

Conversation

JoaoFerreira-FrontEnd
Copy link
Contributor

@JoaoFerreira-FrontEnd JoaoFerreira-FrontEnd commented Feb 24, 2025

Issue number: Internal


What is the new behavior?

Adds a new property to datetime, showAdjacentDays, that when true will show the last days of the previous month and the first days of the next month. This will just occupy empty "cells" at the beginning of the month "table" and add rows to the table until a maximum of 6 rows are displayed.

Changes

  • add styles for adjacent day button
  • add showAdjacentDays property to datetime component
  • change month generation to respect new property
  • add visual tests to new feature

Does this introduce a breaking change?

  • Yes
  • No

Other information

Preview

- add showDaysOutsideCurrentMonth property to datetime  component;
- change month generation to respect new property;
Copy link

vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 9:17pm

@github-actions github-actions bot added package: core @ionic/core package package: angular @ionic/angular package package: vue @ionic/vue package labels Feb 24, 2025
@JoaoFerreira-FrontEnd JoaoFerreira-FrontEnd changed the title - add styles for hidden day button; -feat(ion-datetime): add hidden-days when showDaysOutsideCurrentMonth prop is true Feb 24, 2025
- create specific test page for showDaysOutsideCurrentMonth;
@JoaoFerreira-FrontEnd JoaoFerreira-FrontEnd changed the title -feat(ion-datetime): add hidden-days when showDaysOutsideCurrentMonth prop is true feat(ion-datetime): add hidden-days when showDaysOutsideCurrentMonth prop is true Feb 27, 2025
@BenOsodrac
Copy link
Contributor

@JoaoFerreira-FrontEnd some screenshots are failing, please review this before requesting review 👍

Apart from the comments I already left, I didn't find anything more to comment on! It seems to be working as expected in runtime 💪

@JoaoFerreira-FrontEnd JoaoFerreira-FrontEnd changed the base branch from main to feature-8.5 March 6, 2025 10:32
@brandyscarney brandyscarney changed the title feat(datetime): add showDaysOutsideCurrentMonth to display adjacent month days feat(datetime): add showAdjacentDays to display days from the previous and next months Mar 7, 2025
Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment on JIRA for further feedback. 🙂

Comment on lines +367 to +369
:host .calendar-day.calendar-day-adjacent-day {
opacity: 0.4;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:host .calendar-day.calendar-day-adjacent-day {
opacity: 0.4;
}

This is not necessary because the disabled opacity will be applied by the above rule after removing the opacity checks from ios and md.

Comment on lines +272 to +273

opacity: 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
opacity: 1;

Comment on lines +133 to +134

opacity: 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
opacity: 1;

@@ -267,6 +267,12 @@
color: current-color(contrast);
}

:host .calendar-day.calendar-day-adjacent-day:not([disabled]) {
Copy link
Member

@brandyscarney brandyscarney Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:host .calendar-day.calendar-day-adjacent-day:not([disabled]) {
:host .calendar-day.calendar-day-adjacent-day {

border: 1px solid current-color(base);

background: current-color(base);
}

:host .calendar-day.calendar-day-adjacent-day:not([disabled]) {
Copy link
Member

@brandyscarney brandyscarney Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:host .calendar-day.calendar-day-adjacent-day:not([disabled]) {
:host .calendar-day.calendar-day-adjacent-day {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: angular @ionic/angular package package: core @ionic/core package package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants