Locale FormatDateTime and null values
When converting an empty (null) datetime string, the default value for datatype datetime will be used (0001-01-01T00:00:00).
You can, however, use to default parameter, to implement specific logic for null values.
By returing null from a nested viper method, the default handling is triggered on the enclosing viper.
| Smartsite SXML |
|
|---|---|
{itemdata.field(showfrom)}
{itemdata.field(showfrom, default='not set')}
{locale.formatdatetime(itemdata.field(showfrom))}
{locale.formatdatetimecustom(itemdata.field(showfrom, default=null), 'd MMM yyyy', default='not set')}
|
|
| Example Result |
|
|---|---|
0001-01-01T00:00:00 not set 0001-01-01 00:00:00 not set |
|