sinaatalay / rendercv

The engine of the RenderCV App
http://docs.rendercv.com
MIT License
1.75k stars 116 forks source link

When a end or start date is just YYYY, date comparisons fails #5

Closed jpgoldberg closed 9 months ago

jpgoldberg commented 10 months ago

This is pointing out that #4 is not fully resolved by release https://github.com/sinaatalay/rendercv/releases/tag/v0.7

Describe the bug

It appears that when checking that an end_date is not before a start_date when one of the dates is YYYY, we end up with an attempt to compare in int with a date

ERROR | '>' not supported between instances of 'datetime.date' and 'int'

To Reproduce

Include in the input yaml, something like

 - institution: Stanford University
      url: https://stanford.edu
      area: Linguistics
      study_type: PhD (not completed)
      location: Stanford, California, USA
      start_date: "1984-09"
      end_date: "1987"

Comments

Whatever trick is used to get something like 1984-09 to be a valid datetime.date should be used for YYYY. I haven't looked at the source to see how you manage that.

jpgoldberg commented 10 months ago

Fixing the parsing is easy, but we don't want a YYYY date to render as "Jan. YYYY".

So I believe a fix will require extending or wrapping the Date class.

sinaatalay commented 10 months ago

Hello, I solved the problem by adding some ifs to the code. Although it's not the best solution, it should suffice for our current needs as we do not plan to use more advanced "date" functionalities. I plan to release the new version tomorrow. Thanks for finding this.