Curriculum 'User Guide Viedoc 4'

Controlling the format of a date/time variable Download PDF

1 Add a data check to the date/time field

  • In the field A true constraint expression, use the item ID directly followed by __format == 0. Note the double underscore used.
  • For example (see screenshot): If the Date of birth ID is "DOB", the true expression would be:

    DOB__format == 0
  • A similar expression could be used 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. In such cases you can use the true expression:

    DOB__format == 2
  • If you need to limit the date entry to only allow year, you can use the true expression:

    DOB__format == 3
  • If the entered data must be in a "date and time" format, then you can use the true expression:

    DOB__format == 1
  • In a similar manner, to limit the data entry to a time format, the following can be used:

    TimeItemID__format == 4, where TimeItemID is the ID of the time item for which the data check is written.
  • If any of the above checks should prevent saving, the Allow form save checkbox should be unchecked.

Was this information helpful?