Handle empty dates
Currently when adding a date field to a template and calling a document that doesnt yet have that date filled out the SDK raises an error because it cant convert an empty string or nil to a Date/Time.
It will still raise an error for malformed dates.
This fixes it by returning an empty text fragment (so calling .value) still works.
I thought about a few other approaches but this seems to have the lowest impact. Open to feedback
Btw looks like these same tests that failed are failing in master
What are your thoughts on this @faresd ?
@alistairholt can you help here?
@faresd sure. I'll take a look.
@zjwhitehead thanks for your contribution and apologies for the massive delay in responding. While it works it feels slightly icky that we would return a Prismic::Fragments::Text instance when we are expecting a Prismic::Fragments::Date instance. I think it would be better if we adjust Prismic::Fragments::Date#to_html to simply do an early return with an empty string ('') if the value is nil.