Using Smart Date's Tokens Support

Last updated on
21 August 2023

Smart Date fields have a number of tokens available, to display either the full range, or one of the component values (start, end, duration, etc). These can be displayed using either a smart date format, or using a custom format string as described on the PHP date function page.

The easiest way to find the tokens available is using the "BROWSE AVAILABLE TOKENS" link visible next to a tokens-enabled field.

Screen capture of the tokens available in a Smart Date field.

To show the full range, formatted with a smart date format, the appropriate will be structured like:

[{entity_type}:{field_name}:format:{format_id}]

Note that in the above, the parts in curly braces should be substituted for the values specific to your use case. For example, in the screen shot above, the entity type is node and the field name is field_happening. At the end you should put the machine name of the smart date format you wish to use for formatting. It is also possible, with format-based tokens, to omit this value, in which case the "Default" format will be used. Here is an example of using the format token with the token unspecified:

[node:field_happening:format]

Here is an example with the field above, with a working example of a custom field:

[node:field_happening:value-custom:M jS]

Help improve this page

Page status: No known problems

You can: