Skip to main content

Date profile

Date profiles allow you to restrict the dates that can be selected from a date or datetime attribute. For example, you can use a date profile to ensure users can only select business days, or to prevent users from selecting dates earlier or later than a specified date.

To restrict the dates that can be selected from a date or datetime field, first create a date profile and then apply it to a form field, attribute or platform attribute.

  • To create a date profile, from your Studio, navigate to Platform > Date profiles and click Create date profile.
    • For the minimum (i.e. earliest) and maximum (i.e. latest) date, you can either enter a specific date or use an inline template to calculate a relative date. For example, you might use an inline template to prevent users from selecting a date more than five years in the past or to force users to select a date in the future.
    • Holidays are based on the environment's locale. You can view or change the locale for each of your DTAP environments from My Grexx.
  • To apply a date profile to a form field, attribute, or platform attribute, set the Type to Date or Datetime and then select the relevant Date profile from the picklist.
    • By default, attributes inherit date profiles from platform attributes, and form fields inherit date profiles from attributes. In both cases, you can override the inherited date profile with a different one or remove it completely.
    • You may also want to include an instruction or tooltip alongside the form field in order to provide additional information to your users.

When you have applied a date profile to an attribute or bare form field, the dates that a user can select from the calendar picker are restricted accordingly.

An date picker on an activity form with dates restricted based on a date profile

If a date is populated automatically by a mapping, the date profile is checked when the form is submitted. If the date is not permitted by the date profile, an error is returned.

Tip:

If you are using a form action plugin, you can also restrict the available dates in your JavaScript.