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

rx.moment date prop should accept a datetime #4228

Open
masenf opened this issue Oct 23, 2024 · 3 comments
Open

rx.moment date prop should accept a datetime #4228

masenf opened this issue Oct 23, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@masenf
Copy link
Collaborator

masenf commented Oct 23, 2024

Describe the bug

class State(rx.State):
    date: datetime.datetime = datetime.datetime.now() - datetime.timedelta(days=1)

...

rx.moment(date=State.date)
TypeError: Invalid var passed for prop Moment.date, expected type <class 'str'>, got value reflex___state____state__repro_moment_locale___repro_moment_locale____state.date of type <class 'datetime.datetime'>.

Specifics (please complete the following information):

  • Python Version: 3.12
  • Reflex Version: main
@masenf masenf added the bug Something isn't working label Oct 23, 2024
Copy link

linear bot commented Oct 23, 2024

@linear linear bot assigned masenf Oct 23, 2024
@mistamun
Copy link

Same with form.input(type="date") I suppose

@linear linear bot closed this as completed Oct 25, 2024
@masenf
Copy link
Collaborator Author

masenf commented Oct 28, 2024

Reopening as this change was de-scoped from the merged PR

@masenf masenf reopened this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants