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

🐞 - InputTime has redundant assert log (dev mode only) if maxValues has non-default values #8372

Closed
2 of 9 tasks
nsbarsukov opened this issue Aug 6, 2024 · 2 comments
Closed
2 of 9 tasks
Assignees
Labels
community contribution This issue was closed by a PR from the community P3 This issue has low priority S3 This issue has low severity

Comments

@nsbarsukov
Copy link
Member

Playground Link

https://taiga-ui.dev/components/input-time#options-max

Description

  1. Run development mode of our demo application
  2. Open this example locally https://taiga-ui.dev/components/input-time#options-max
  3. Enter 33:33

See devtool console:

Assertion failed: Time must be real, but got: 33 33 0 0

Expected behavior:
Disable this check

tuiInRange(hours, 0, HOURS_IN_DAY) &&

if (or other similar cases)

tuiInputTimeOptionsProvider({
    mode: 'HH:MM',
    maxValues: {HH: 47, MM: 59, SS: 59, MS: 999},
})

(or make it more flexible)

Angular version

16

Taiga UI version

4.0.0-rc.8

Which browsers have you used?

  • Chrome
  • Firefox
  • Safari
  • Edge

Which operating systems have you used?

  • macOS
  • Windows
  • Linux
  • iOS
  • Android
@nsbarsukov nsbarsukov added bug contributions welcome Architecture is clear and community can help P3 This issue has low priority S3 This issue has low severity labels Aug 6, 2024
@Chiorufarewerin
Copy link
Contributor

I will try it

@Chiorufarewerin
Copy link
Contributor

Why do you think that log is redundant? And i'm kinda interested why the InputTime has this ability for passing time with hours more that 23 at the first place.

I wonder if we change this behavior (passing time more than 23 hours) it will introduce breaking changes in the TuiTime for methods like isValidTime, fromAbsoluteMilliseconds, shift. We could make it flexible if we introduce another parameter maxHours/unlimitedHours or kind of like that but it will be looking awful.
I think the current TuiTime works as expected.

I think the correct way to introduce the new TuiTimeDelta (similar to python datetime.timedelta) or TuiTimeDistance, and return it from InputTimeComponent.
For example: we introduce returnValue in the TuiInputTimeOptions , that will be accepting TuiTime (default) or TuiTimeDistance (for hours greater than 23 will be throwing an error in component that acception only TuiTimeDistance).

And why InputTime is in the legacy section and all TUI_TIME_OPTIONS are deprecated?

@waterplea waterplea added community contribution This issue was closed by a PR from the community and removed contributions welcome Architecture is clear and community can help labels Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community contribution This issue was closed by a PR from the community P3 This issue has low priority S3 This issue has low severity
Development

No branches or pull requests

4 participants