-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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/datepicker/datepicker-toggle/datepicker-toggle.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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/datepicker/datepicker-toggle/datepicker-toggle.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
# 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ;-)
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 attributedata-now
tonow
. The propertynow
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 attributedata-now
tonow
. The propertynow
has to be in the format "HH:MM:SS".