Controlling the format of a date/time variable
Introduction
It is possible to control the format of a Date/Time item in Viedoc, by adding a data check to the item. This is done on the Validation tab of the Item Settings pop-up, by entering the following code in the field A true constant expression:
ItemID__format == n
, where n can have one of the values 0,1,2, or 3, depending on the desired format, as described below.
Date/Time item
For example, if the Date of birth field has the ID = DOB:
the true expression would be:
DOB__format == 0
, for a complete date format.DOB__format == 1
, for a date and time format.DOB__format == 2
, if you would need to limit the date entry to only allow year and month, and not permit day entry. For example there are limitation in certain countries to collect a full date of birth.DOB__format == 3
, if you need to limit the date entry to only allow year.