Rock Mobile Docs

Date Picker

Inherits from Xamarin.Forms.DatePicker

Presents a field that displays the selected date (or placeholder text) and allows the user to change the date. During edit mode, the date picker also exposes a Clear button that allows the user to clear the selected date completely.

Properties

PropertyTypeDescription
LabelstringThe label title to be used when wrapped in a control that displays a label for the field.
IsRequiredboolIf True then any validation performed will require that a date be selected.
PlaceholderstringThe text to display in the field if no date is selected.
SelectedDateDateTime?The currently selected date or null if no date is selected.
DatePickerStyleDatePickerStyle(iOS only) - Use this to change the OS-level style of the Date Picker.

DatePickerStyle

This property/enum only makes a difference on iOS.

NameDescription
WheelsThe default value -- displays the Wheels style date picker.
InlineA calendar style date picker.

Example

<Rock:FieldContainer>
    <Rock:DatePicker Label="Rock Date Picker"
        IsRequired="false"
        SelectedDate="7/4/2019" />
</Rock:FieldContainer>

Native date picker on iOS

Note

How to update the year is not immediately apparent on Android - you must tap the year at the top and not the date between the arrows.

Native date picker on Android

<Rock:FieldContainer>
    <Rock:DatePicker Label="Rock Date Picker"
        IsRequired="false"
        SelectedDate="7/4/2019"
        DatePickerStyle="inline" />
</Rock:FieldContainer>

Native iOS picker with an Inline DatePickerStyle.