MonoTouch.Dialog icon indicating copy to clipboard operation
MonoTouch.Dialog copied to clipboard

Added Optional Dates for DateElement, TimeElement, and DateTimeElement

Open eclipsed4utoo opened this issue 11 years ago • 3 comments

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

eclipsed4utoo avatar Jul 05 '13 13:07 eclipsed4utoo

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

migueldeicaza avatar Jul 05 '13 15:07 migueldeicaza

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 avatar Jul 05 '13 19:07 eclipsed4utoo

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.

eclipsed4utoo avatar Jul 05 '13 19:07 eclipsed4utoo