DatePicker

Last Updated On 2021-07-16

Version 4MinSDK 7Tutorial Video

A button that, when clicked on, launches a popup dialog to allow the user to select a date.


Properties

You can set the below properties in the UI part of the builder.

  • BackgroundColor - it's a color value which is set to &h00000000 by default.
  • CustomFontTypeFace - it's a asset value which is set to blank by default.
  • Enabled - it's a boolean value which is set to true by default.
  • FontBold - it's a boolean value which is set to false by default.
  • FontItalic - it's a boolean value which is set to false by default.
  • FontSize - it's a non negative float value which is set to 14.0 by default.
  • FontTypeface - it's a typeface value which is set to 0 by default.
  • HeihMargin - it's a four value which is set to 0,0,0,0 by default.
  • HeihPadding - it's a four value which is set to 0,0,0,0 by default.
  • Image - it's a asset value which is set to blank by default.
  • MarginBottom - it's a non negative float value which is set to 0 by default.
  • MarginLeft - it's a non negative float value which is set to 0 by default.
  • MarginRight - it's a non negative float value which is set to 0 by default.
  • MarginTop - it's a non negative float value which is set to 0 by default.
  • Opacity - it's a integer value which is set to 0 by default.
  • PaddingBottom - it's a non negative float value which is set to 0 by default.
  • PaddingLeft - it's a non negative float value which is set to 0 by default.
  • PaddingRight - it's a non negative float value which is set to 0 by default.
  • PaddingTop - it's a non negative float value which is set to 0 by default.
  • Shape - it's a button shape value which is set to 0 by default.
  • ShowFeedback - it's a boolean value which is set to true by default.
  • Text - it's a string value which is set to blank by default.
  • TextAlignment - it's a textalignment value which is set to 1 by default.
  • TextColor - it's a color value which is set to &h00000000 by default.
  • Visible - it's a visibility value which is set to true by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

BackgroundColor

Returns the button's background color


CustomFontTypeFace

Sets the custom font


Day

the Day of the month that was last picked using the DatePicker.


Enabled

If set, user can tap DatePicker to cause action.


FontBold

If set, DatePicker text is displayed in bold.


FontItalic

If set, DatePicker text is displayed in italics.


FontSize

Point size for DatePicker text.


Height

Specifies the vertical height of the DatePicker, measured in pixels.


HeightPercent

Specifies the vertical height of the DatePicker as a percentage of the height of the Screen.


Image

Image to display on button.


Instant

the instant of the date that was last picked using the DatePicker.


MarginBottom

Property for MarginBottom


MarginLeft

Property for MarginLeft


MarginRight

Property for MarginRight


MarginTop

Property for MarginTop


Month

the number of the Month that was last picked using the DatePicker. Note that months start in 1 = January, 12 = December.


MonthInText

Returns the name of the Month that was last picked using the DatePicker, in textual format.


Opacity

Set opacity value between 1 to 10


PaddingBottom

Property for PaddingBottom


PaddingLeft

Property for PaddingLeft


PaddingRight

Property for PaddingRight


PaddingTop

Property for PaddingTop


ShowFeedback

Specifies if a visual feedback should be shown for a DatePicker that has an image as background.


Text

Text to display on DatePicker.


TextColor

Color for button text.


Visible

Specifies whether the DatePicker should be visible on the screen. Value is true if the DatePicker is showing and false if hidden.


Width

Specifies the horizontal width of the DatePicker, measured in pixels.


WidthPercent

Specifies the horizontal width of the DatePicker as a percentage of the width of the Screen.


Year

the Year that was last picked using the DatePicker



Methods

You can set the below method blocks in the blocks section of the builder.

LaunchPicker

Launches the DatePicker dialog.

PerformClick

Method for PerformClick

SetDateToDisplay

Allows the user to set the date to be displayed when the date picker opens. Valid values for the month field are 1-12 and 1-31 for the day field.

SetDateToDisplayFromInstant

Allows the user to set the date from the instant to be displayed when the date picker opens.


Events

You can set the below event blocks in the blocks section of the builder.

AfterDateSet

Event that runs after the user chooses a Date in the dialog

GotFocus

Indicates the cursor moved over the DatePicker so it is now possible to click it.

LostFocus

Indicates the cursor moved away from the DatePicker so it is now no longer possible to click it.

TouchDown

Indicates that the DatePicker was pressed down.

TouchUp

Indicates that the DatePicker has been released.