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: add 'now' property instead of data-now attribute #2674

Merged
merged 22 commits into from
Jun 4, 2024

Conversation

DavideMininni-Fincons
Copy link
Contributor

@DavideMininni-Fincons DavideMininni-Fincons commented May 21, 2024

Closes #2654

BREAKING CHANGE: The half-public data-now attribute has become a public now property that can be used to set time or date-based components into a specific state, especially for testing purposes.

  • sbb-calendar, sbb-datepicker, sbb-timetable-row, sbb-journey-summary, sbb-pearl-chain, sbb-pearl-chain-time: change the attribute data-now to now. The property now can be a Date or Unix timestamp. Just so you know, if you had a timestamp in milliseconds before, please divide by 1000 to get seconds.
  • sbb-clock: change the attribute data-now to now. The property now has to be in the format "HH:MM:SS".

Copy link
Contributor

@jeripeierSBB jeripeierSBB left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this issue. To start only some general questions.

src/components/calendar/calendar.ts Outdated Show resolved Hide resolved
src/components/calendar/calendar.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@TomMenga TomMenga left a comment

Choose a reason for hiding this comment

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

Some other minor fixes :)

src/components/calendar/calendar.ts Outdated Show resolved Hide resolved
src/components/calendar/calendar.ts Outdated Show resolved Hide resolved
src/components/clock/clock.ts Outdated Show resolved Hide resolved
src/components/datepicker/datepicker/datepicker.ts Outdated Show resolved Hide resolved
src/components/calendar/readme.md Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pr2674 May 23, 2024 16:39 Inactive
@github-actions github-actions bot temporarily deployed to pr2674 May 24, 2024 07:55 Inactive
Copy link
Contributor

@TomMenga TomMenga left a comment

Choose a reason for hiding this comment

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

Just two minimal things :)
We should decide whether to also support the Date type in the mixin (I vote for yes)

src/components/calendar/calendar.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pr2674 May 28, 2024 08:52 Inactive
@github-actions github-actions bot temporarily deployed to pr2674 May 28, 2024 14:29 Inactive
Copy link
Contributor

@jeripeierSBB jeripeierSBB left a comment

Choose a reason for hiding this comment

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

I think there could be an even cleaner API. We can also discuss it, if you like.

src/components/core/mixins/now-mixin.ts Outdated Show resolved Hide resolved
src/components/core/mixins/now-mixin.ts Outdated Show resolved Hide resolved
src/components/core/mixins/now-mixin.ts Outdated Show resolved Hide resolved
src/components/datepicker/datepicker/datepicker.ts Outdated Show resolved Hide resolved
@jeripeierSBB jeripeierSBB added this to the Release 1.0.0 milestone May 29, 2024
# Conflicts:
#	src/elements-experimental/journey-summary/journey-summary.ts
#	src/elements-experimental/pearl-chain-time/pearl-chain-time.ts
#	src/elements-experimental/pearl-chain/pearl-chain.ts
#	src/elements-experimental/timetable-row/timetable-row.ts
#	src/elements/core/datetime/data-now.ts
#	src/elements/core/mixins/now-mixin.ts
@github-actions github-actions bot temporarily deployed to pr2674 June 3, 2024 12:29 Inactive
@github-actions github-actions bot temporarily deployed to pr2674 June 3, 2024 12:49 Inactive
Copy link
Contributor

@jeripeierSBB jeripeierSBB left a comment

Choose a reason for hiding this comment

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

LGTM ;-)

@github-actions github-actions bot added the pr: lead review approved Pull request has been approved by a lead review label Jun 4, 2024
@jeripeierSBB jeripeierSBB merged commit 94c25b1 into main Jun 4, 2024
30 of 31 checks passed
@jeripeierSBB jeripeierSBB deleted the feat/add-now-prop branch June 4, 2024 08:59
@github-actions github-actions bot removed the pr: peer review required A peer review is required for this pull request label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diff-available pr: lead review approved Pull request has been approved by a lead review preview-available
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data-now should become a public @property
3 participants