DATE() will return 1970-01-01 for an empty input. Now, if using a year or part of the date to create namespaces dynamically, this can throw things quite off. This patch adds a check if the supplied date is empty or the strototime() throws an error, and returns an empty string for this case.
This behavior is especially useful for complex forms, where multiple input is possible for the date, and either one or the other is valid only. In my example, running projects and planned projects evaluate differently, and the namespace is composed dynamically based on the input.
DATE() will return 1970-01-01 for an empty input. Now, if using a year or part of the date to create namespaces dynamically, this can throw things quite off. This patch adds a check if the supplied date is empty or the strototime() throws an error, and returns an empty string for this case.
This behavior is especially useful for complex forms, where multiple input is possible for the date, and either one or the other is valid only. In my example, running projects and planned projects evaluate differently, and the namespace is composed dynamically based on the input.