-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Date and DateTime Pickers #1126
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.
Not sure why these would need to be separate components when the same effect can be achieved by passing pc.input(..., type_="datetime-local")
Yes, the implementation is simple, but it’s a feature that has been discussed multiple times. It’s also the same method used for the email and password components. |
Okay, makes sense. Down the road this will let the project swap out the default components for something more specialized without downstream users having to change their code. |
078d362
to
9b44623
Compare
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 adding! Just some comments about naming to keep it consistent with the other components
pynecone/components/__init__.py
Outdated
@@ -91,6 +91,8 @@ | |||
checkbox = Checkbox.create | |||
checkbox_group = CheckboxGroup.create | |||
copy_to_clipboard = CopyToClipboard.create | |||
datepicker = DatePicker.create |
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.
Can we call this date_picker
and date_time_picker
(to match the capitalization of the classes)
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.
changed in commit 7fb7ebf
@@ -0,0 +1,11 @@ | |||
"""A date input component.""" |
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.
Can we also change the filenames to date_picker.py
and date_time_picker.py
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.
changed in commit 7fb7ebf
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 the update!
Add Date and DateTime Pickers
This PR implements a
datepicker
anddatetimepicker
component by inheriting the Input component and using the appropriatetype
attributes.I opted to use base html for these components as I felt the available React and Chakra libraries introduced unnecessary complexity, and the default styling for the
datepicker
anddatetimepicker
elements looks decent out of the box.Note: given these components are implemented as inputs, their value will be a string.
closes #237
P.S. Would love to be considered for the Software Engineering Intern role (if still open) ;)
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features: