---
schema_version: "1"
id: 5e096229cf988cf25ff207dd6a66328de2d1b26f6ebf953fa1af5648eae8c4ff
title: Omniscripts Date Element
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_omniscripts_date_element_16498.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_omniscripts_date_element_16498.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 1b4ff5d095d04256756b97bb22c867811887e8ecf6efb80c7d2d5ebf9f47c72e
description: Enable users to select a date from a date picker by adding a Date element to your Omniscript. Set the minimum and maximum dates and the date format.
products:
  - Omnistudio
release: "264"
---
# Omniscripts Date Element

Enable users to select a date from a date picker by adding a Date element to your Omniscript. Set the minimum and maximum dates and the date format.

1. Enter the earliest date the user can select from the date picker, such as 01-01-1950.
    
    You can pick a fixed date, or you can enter a relative date in the format `TODAY +/- N day(s)/week(s)/month(s)/year(s)`. For example, you can enter `TODAY — 1 day` or `TODAY + 3 months`.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_note.png)
    
    Note
    
    The format entered must be the same as specified in the date display format. For example, to set the minimum date to January 1, 1950, if the date format is MM-DD-YYYY, enter 01-01-1950.
    
    The Minimum Date field doesn't accept merge fields.
2. Enter the latest date the user can select from the date picker, such as 12-31-2019.
    
    You can pick a fixed date, or you can enter a relative date in the format `TODAY +/- N day(s)/week(s)/month(s)/year(s)`. For example, you can enter `TODAY — 1 day` or `TODAY + 3 months`.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_note.png)
    
    Note
    
    The format entered must be the same as specified in the date display format. For example, to set the minimum date to January 1, 1950, if the date format is MM-DD-YYYY, enter 01-01-1950.
    
    The Maximum Date field doesn't accept merge fields.
3. Enter the format to display the date.
    
    For example, if the format is MM-DD-YYYY, and the user selects January 3, 2020 from the date picker, the date displays as 01-03-2020. For more format options, see [Day.js](https://day.js.org/docs/en/parse/string-format).
4. In the Advanced Options section, update values for the following properties:
    - Data Type: Specifies how to display the date in the Data JSON.
        
        If set to String, the specified format is applied. String is the default data type.
        
        If set to Date, the date is encoded as an ISO 8601 datetime, such as 2018-01-28T05:00:00.000Z, in the GMT/UTC time zone.
        
        Using this format instead of a String such as `YYYY-MM-DD` without a time requires a thorough understanding of time zone handling. Midnight of the date is converted from either the org time zone or the user's time zone to GMT/UTC.
    - **Format**: Specifies how the date is formatted in the Data JSON when **Data Type** is set to **String**. For example, YYYY-MM-DD. In the designer for a managed package, specify the format in the **Model Date Format** field. For more format options, see [Day.js](https://day.js.org/docs/en/parse/string-format).
        
        The Date element's **Model Date Format** must match the Omnistudio Data Mapper's date format. Mismatched date formats can result in a blank Date element.
5. Enter a **Default Value**. See [Set a Default Value for an Omniscript Element](https://help.salesforce.com/s/articleView?id=xcloud.os_set_a_default_value_for_an_element_22037.htm&release=264.0.0&type=5 "The Default Value property sets the JSON value of an element to a static value by default. The default value is overwritten if the element is prefilled from an Omnistudio Data Mapper or JSON response. The Default Value property is available for the Input elements (except Custom LWC, Disclosure, File, Image, and Password).").
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_note.png)
    
    Note
    
    The format entered must be the same as in the specified in the date display format. field. For example, to set the minimum date to January 1, 1950, if the date display format is MM-DD-YYYY, you must enter 01-01-1950.
    
    The date picker lets the user choose a date that is +/- 100 years from the default date.