Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (19 sloc) 998 Bytes

Validate input date against a given date format.

A quick guide to validating a date in Zotonic:

<input type="text" id="my_date" name="my_date" value="" />
{% validate id="my_date" type={date separator="\" format="b"} %}

This code validates when the user enters a date in the following format:

yyyy\mm\dd

Arguments:

Argument Description Example
separator Character used to separate date parts, such as / - . Defaults to "-". separator="-"
format Date format, big endian (starting with year), little endian (starting with day) or middle endian (starting with month). Defaults to "l" (little). format="m"
Jump to Line
Something went wrong with that request. Please try again.