Fix Collection UDF date serialization

We were not correctly formatted dates for collection UDFs, which broke the
API for editing, since the server sent dates down in a format it could
not parse.