New helper function for validation of inputs across form sections.
The function getValueAsMoment is available in the classes TangyPartialDate and TangyEthiopianDate. The function turns any date value including unkown values into useful momentjs objects, e.g.:
// with unknown day
inputs.SOME_DATE.value = "2022-03-99"
var _moment = inputs.SOME_DATE.getValueAsMoment()
_moment.isValid()
> true
_moment.format('MM/YYYY')
> 03/2022
HOWEVER this function is only available if you are inside a tangy-form on-submit or on-change logic, or in the tangy-form-item in which the variable is defined. So this does not currently work:
New helper function for validation of inputs across form sections.
The function
getValueAsMoment
is available in the classesTangyPartialDate
andTangyEthiopianDate
. The function turns any date value including unkown values into useful momentjs objects, e.g.:HOWEVER this function is only available if you are inside a
tangy-form
on-submit or on-change logic, or in thetangy-form-item
in which the variable is defined. So this does not currently work:This addition will make it so you can use the following logic to check dates against each other anywhere in a form, e.g.: