Date
Represents a calendar date. The year is unsigned so negative years are supported.
- Kotlin Definition:
DateDefinition - Kotlin Value:
LocalDate - Maryk Yaml Definition:
Date
Usage options
Section titled “Usage options”- Value
- Map Key or Value
- Inside List/Set
Validation Options
Section titled “Validation Options”required- default truefinal- default falseunique- default falseminValue- default unset. Minimum valuemaxValue- default unset. Maximum value
Other options
Section titled “Other options”default- the default value to be used if value was not set.
Examples
Section titled “Examples”Example of a Date property definition for use within a Model
val birthDate by date( index = 1u, required = false, final = true, unique = true, default = LocalDate(2018, 4, 30), minValue = LocalDate(1900, 1, 1), maxValue = LocalDate(2100, 1, 1))Example of a Date property definition
val def = DateDefinition( required = false, final = true, unique = true, default = LocalDate(2018, 4, 30), minValue = LocalDate(1900, 1, 1), maxValue = LocalDate(2100, 1, 1))Storage Byte representation
Section titled “Storage Byte representation”The date is represented by a 4 byte Int counting the amount of days from January 1st 1970
Transport Byte representation
Section titled “Transport Byte representation”The date is represented by a VarInt with the days since January 1st 1970
String representation
Section titled “String representation”ISO8601 String: YYYY-MM-DD
Example: 2018-04-24