4teamwork / ftw.solr

Solr integration for Plone
5 stars 5 forks source link

Fix to_iso8601 for years before 1900. #153

Closed deiferni closed 4 years ago

deiferni commented 4 years ago

Implement formatting to support years before 1900 for date and datetime instances.

Python 2.7 can't handle that yet as per https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior.

I tried various approaches but ended up implementing the formatting myself as has already been done for DateTime instances. To prevent any issues with solr i'd like to keep the output stable and avoid changing the string representation of dates too much, especially since this is intended as a bugfix level release. Switching to isoformat or the arrow library would all have significantly changed the iso8601 string.