Grammar Documentation for node type "DateRule"
Last updated
Last updated
DateRules are rules that apply on values which have the data type "Date" from Schema.org.
The specific rule type is given by the value in the "$rule" property. The properties which rules can have are explained in the Meta_Rules.md document. Note that the "subject" property can be omitted, if the "$path" object has an empty JSON Pointer as value (see Meta_Rules.md for details).
However, the data type for the "parameter" depends on the "$rule" value (e.g. arguments for the rule function), and is explained in the following.
The "equals" rule checks if a given Date value (the validated value) matches a given Date.
The parameter is a Date which serves as the second argument for the rule function. The validated subject must be the same as the given parameter.
The "isBefore" rule checks if a given Date value (the validated value) is chronologically before a given Date.
The parameter is a Date which serves as the second argument for the rule function. The validated subject must be chronologically before the given parameter.
The "isAfter" rule checks if a given Date (the validated value) is chronologically after a given Date.
The parameter is a Date which serves as the second argument for the rule function. The validated subject must be chronologically after the given parameter.
The "isInSet" rule checks if a given Date (the validated value) is in the given set of allowed values.
The parameter is an array which contains Dates, which are valid instances for a given Date (the validated subject).
The "hasYear" rule checks if a given Date (the validated value) has a value for the year, that is conform to a given numeric pattern.
The parameter is a numeric pattern, that has to be matched by the year of a given Date (the validated subject).
The "hasMonth" rule checks if a given Date (the validated value) has a value for the month, that is conform to a given numeric pattern.
The parameter is a numeric pattern, that has to be matched by the month of a given Date (the validated subject).
The "hasDay" rule checks if a given Date (the validated value) has a value for the day, that is conform to a given numeric pattern.
The parameter is a numeric pattern, that has to be matched by the day of a given Date (the validated subject).