# Date Input Component

## Overview

The date input component allows users to easily select dates. It's like a digital calendar where users can pick dates for appointments, deadlines, or any time-related tasks within an app. These components are essential because they simplify entering dates, reducing errors and ensuring accuracy. The date input component utilizes the native Android and iOS date pickers.

![Native Android date picker on the left and iOS on the right.](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LnTo13qf4HKd1AV6bl9%2F-LnTo9AJqy55zEn2QNWQ%2FThunkable%20Docs%20Exhibits%20\(37\).png?alt=media\&token=0e123d9f-ae9b-47c5-9008-323cb0c3e6c3)

## Properties

### Date Input

| Property    | Description                                 | Data Type                                                                            |
| ----------- | ------------------------------------------- | ------------------------------------------------------------------------------------ |
| Style       | Format to use when displaying selected date | Select from menu `[YYYY-MM-DD, MM/DD/YYYY, M/D/YY, Month Day, Year, Mth. Day, Year]` |
| Font Size   | Size of font when displaying date           | Number                                                                               |
| Font Style  | Make the date's text italicized             | True/False                                                                           |
| Font Weight | Make the date's text bold                   | True/False                                                                           |
| Color       | Color of font when displaying date          | Color                                                                                |

### Layout

| Property    | Description                                                                          | Data Type                                    |
| ----------- | ------------------------------------------------------------------------------------ | -------------------------------------------- |
| X           | Location of top left corner of date input on X-axis, where the left hand side is X=0 | Number                                       |
| Y           | Location of top left corner of date input on Y-axis, where the top side is Y=0       | Number                                       |
| Height      | Height of date input in pixels                                                       | Number                                       |
| Width       | Width of date input in pixels                                                        | Number                                       |
| Resize Mode | Define dimensions of the date input component.                                       | Select from list `[Stretch, Float in Place]` |

### **Style**

| Property       | Description                                                                             | Data Type                                  |
| -------------- | --------------------------------------------------------------------------------------- | ------------------------------------------ |
| Visible        | Toggle whether your end users can see the date input                                    | True/False                                 |
| Border Style   | Set whether border style is solid, dotted or dashed  (only visible if border width > 0) | Select from list `[solid, dotted, dashed]` |
| Border Color   | Color of border (only visible if border width > 0)                                      | Color                                      |
| Border Width   | Width of border around date input in pixels                                             | Number                                     |
| Border Radius  | Radius of corners of border on date input in degrees                                    | Number                                     |
| Shadow Color   | Color of date input's shadow                                                            | Color                                      |
| Shadow Opacity | Opacity of date input's  shadow                                                         | Number between 0 and 100                   |
| Shadow Radius  | Radius of corners of date input's shadow in pixels                                      | Number                                     |
| Shadow Offset  | How far date input's shadow should be offset, in height and width, in pixels            | Number                                     |

## Date Input Blocks

### Event Blocks

You can trigger actions to happen when an event occurs.

#### When Date Input Date Picked

This event fires when the user has selected a date using the date picker.

<div align="left"><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MWd1ztfxxPjInQ3k4cx%2F-MWdA1uH__kEF6072Xxp%2Fdp1-8.png?alt=media&#x26;token=aa388934-9a7a-486b-b33c-4421a3347518" alt=""></div>

### Function Blocks

#### Call Date Input's Get Date&#x20;

Returns the date from the date picker in the format Mon., DD, YYYY.

<div align="left"><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MWd1ztfxxPjInQ3k4cx%2F-MWdAhGTOQx-WGCokRJs%2Ff_get_date.png?alt=media&#x26;token=ed7f39a0-8b9b-4b2e-9e50-38d83b226af1" alt=""></div>

#### Call Date Input's Get Day&#x20;

Returns the date from the date picker in numeric form. For example, if the user selects February 17, 2024, this block returns 17. If they select 5 March 2025, this block returns 5.

<div align="left"><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MWd1ztfxxPjInQ3k4cx%2F-MWdAiVLU7JxA18syGRC%2Ff_get_day.png?alt=media&#x26;token=786e5d90-2f97-4c21-a713-87cd885c68e8" alt=""></div>

#### Call Date Input's Get Month&#x20;

Returns the month from the date picker in numeric form. For example, if the user selects February 17, 2024, this block returns 2. If they select 5 March 2025, this block returns 3.

<div align="left"><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MWd1ztfxxPjInQ3k4cx%2F-MWdAjkHYVUIsDwP5zZg%2Ff_get_month.png?alt=media&#x26;token=b1d75d07-a301-46bb-bd81-35739998c540" alt=""></div>

#### Call Date Input's Get Year&#x20;

Returns the year from the date picker in YYYY form.

<div align="left"><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MWd1ztfxxPjInQ3k4cx%2F-MWdAl-Eu3k3_ZMB3ULP%2Ff_get_year.png?alt=media&#x26;token=fc75eca5-392a-4c05-9a82-7c70812e48a3" alt=""></div>

#### Call Date Input's Launch Picker

Opens the date picker to prompt the user to enter a date.

<div align="left"><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MWd1ztfxxPjInQ3k4cx%2F-MWdAm_370RLIyru1RM8%2Ff_launch_picker.png?alt=media&#x26;token=dc40af26-2913-4c1f-9c90-f44655178074" alt=""></div>

### Properties Blocks

There are two types of property blocks: dark green "set" and light green "get" blocks. The specific blocks available vary according to the UI component.

The dark green set blocks allow you to change the component's properties using blocks. For example, if you don't want a group component to be enabled for a user until they've typed a set number of characters into a text input component, you can use the group's dark green set group's disabled status block.

The light green get blocks allow you to access the properties of a component (e.g. color, font, width, text, etc.).&#x20;
