sinaatalay / rendercv

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

Allow {start|end}_date to be less precise than a specific day #4

Closed jpgoldberg closed 10 months ago

jpgoldberg commented 10 months ago

I would like to specify start and end dates in terms of months. For example

 education:
    - institution: University of California, Santa Cruz
        url: https://ucsc.edu
        area: Linguistics
        study_type: BA
        location: Santa Cruz, Calinfornia, USA
        start_date: "1979-09"
        end_date: "1984-06"

As you might imagine, I am disinclined to dig through 40 year old records to determine the precise day of the month for those events, and anyone reading the CV isn't going to care.

Describe the solution you'd like start_date and end_date should allow YYYY-MM and YYYY forms of RFC3339 dates.

Additional context

I suspect that "1979-09" is a valid RFC3339 date, in which case my feature request may be considered a bug report.

I haven't looked at the source code (yet) to see if I can produce a useful pull request.

jpgoldberg commented 10 months ago

I now see that this constraint is coming from the python standard datetime library.

>>> from datetime import date
>>> date.fromisoformat('1979-09')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid isoformat string: '1979-09'

Oh well. I guess this is a difficult feature request instead of a quick fix.

sinaatalay commented 10 months ago

It was indeed a feature request but a necessary one. If the date data is not there with month and day precision, it should be totally fine with RenderCV.

I coded a custom date parser. I didn't write tests for it yet, but it seemed fine with a few manual runs. I will release RenderCV with this new feature in ~20 minutes.

Thank you!

jpgoldberg commented 10 months ago

I don't see a way to reopen this issue, so I will create a new one pointing out that the fix ran in a problem.