Skip to content

[regression] "format" prop is gone from TimeInput #583

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

Open
sergei3000 opened this issue May 7, 2025 · 6 comments · May be fixed by #584
Open

[regression] "format" prop is gone from TimeInput #583

sergei3000 opened this issue May 7, 2025 · 6 comments · May be fixed by #584
Labels
upstream issue Issue can't be fixed in dmc

Comments

@sergei3000
Copy link

I just tried upgrading DMC in my environment and am getting this error when running my Dash app

Exception has occurred: TypeError
The `dash_mantine_components.TimeInput` component (version 1.1.1) with the ID "start-time--" received an unexpected keyword argument: `format`

Before upgrading the same code worked fine.
The code being like

return  dmc.TimeInput(
        label=label,
        id=id_,
        withSeconds=True,
        format="24",
        value=datetime.datetime.now(),
        style={"width": 180},
    )

As you can see, I set the format prop to "24" to use the 24 hour format instead of the AM/PM one. But this property got lost at some point.
This is important as people in my organization specifically requested the 24 hour format and we use it all over the place.

@AnnMarieW
Copy link
Collaborator

what version are you upgrading from?

@AnnMarieW
Copy link
Collaborator

I assume you are upgrading from 0.12 which was based on Mantine V5

In Mantine V6 the format prop was removed https://v6.mantine.dev/changelog/6-0-0/

In Mantine V8 (released a couple days ago), there is a new TimePicker component that has a lot more features, including the format prop. More info here https://mantine.dev/dates/time-input/. This will be available in DMC V2 which will be based on Mantine V8. I haven't started that project yet, so I'm not sure when that will be ready.

@AnnMarieW AnnMarieW added the upstream issue Issue can't be fixed in dmc label May 7, 2025
@sergei3000
Copy link
Author

Yes, I'm upgrading from 0.12.
Is it possible to just add this prop to DMC even though it's not in Mantine V6? Looks like I can't upgrade to Dash 3 without this as only DMC>=1.0 supports it but I can't upgrade to DMC 1.0 because this prop is absent from it. Is there a way from this vicious circle?:)

@AnnMarieW
Copy link
Collaborator

AnnMarieW commented May 7, 2025

Unfortunately it's not possible to add the format prop to the current version because the upstream Mantine component does not support it.

I wish I had a better answer for you, but if that format prop is required, and you want to use a dmc component for the time input, it looks like the only option is to stay on dmc 0.12 or wait for dmc 2.0.

You could see if anyone has published a dash timepicker as a separate component. Another option is to make your own custom dash component (at least to use until dmc 2 is released) I made one a few years ago: https://github.com/AnnMarieW/dash-more-components?tab=readme-ov-file#timepicker. It wraps https://github.com/wojtekmaj/react-time-picker

@AnnMarieW
Copy link
Collaborator

@sergei3000

Good news! I've started working on the PR for DMC V2 and making good progress. I'll try to prioritize adding the new TimePicker , but if you would like to help speed things up, I'd be delighted to get a PR for that component 🙂

@sergei3000
Copy link
Author

This is great news indeed, thank you so much for working on this

@AnnMarieW AnnMarieW linked a pull request May 18, 2025 that will close this issue
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream issue Issue can't be fixed in dmc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants