InfoPath - check leap year using expression
This is a fun one.
- Use the undocumented msxsl:utc function, which checks / converts a date into a normalized representation.
- So, what will happen if I test it with with a garbage date, say, the 29th of February of 2001, which isn't a leap year?
- So just check if the result of the utc function returns empty string or not.
Expression
msxsl:utc(concat(my:year, "-02-29")) != ""