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

Added Optional Dates for DateElement, TimeElement, and DateTimeElement #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eclipsed4utoo
Copy link

Added ability for null dates in the DateElement, TimeElement, and
DateTimeElement.

Added ability for null dates in the DateElement, TimeElement, and
DateTimeElement.
@migueldeicaza
Copy link
Owner

Hello,

Could you please describe how the feature is supposed to be used?

In general, I ask for documentation for new features in the docs/ directory, but I realize it can be cumbersome to setup our tooling, so at least we need docs on what the new behavior is, and what these properties do, and what effects it has on the code.

It should also come with tests demonstrating the feature

Miguel

@eclipsed4utoo
Copy link
Author

With the current Date/Time/DateTime elements, we can't add it to a view and not give it a value. Sometimes, we just want to show the element without having to give it a date. For my company, we have optional DateTime fields that the user could or could not give us. We didn't want any date to show in the element unless the user chose one.

These changes allow for a developer to give NULL for the DateTime value(for the constructor) and the element won't display anything. The element changes the navigation bar to include a Cancel button on the right. Clicking Cancel allows the user to not choose a date. The Cancel button will be a Clear button if the element is clicked on and a value already exists for the element. This allows the user to clear an already set element value.

@eclipsed4utoo
Copy link
Author

It also allows the developer to say whether the value is required or not. If the value is required, they can still give a NULL date, but the Cancel/Clear button won't show up. This forces the user to give a value, but doesn't force the developer to give a default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants