Convert UDF collection values to YYYY-MM-DD when saving.

Fixes #1657
Merge pull request #1659 from maurizi/fix-udf-collection-date-saving

Convert UDF collection values to YYYY-MM-DD when saving.