Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid isoformat string when Month < 10 #2

Closed
stefancrain opened this issue Jan 18, 2020 · 2 comments
Closed

Invalid isoformat string when Month < 10 #2

stefancrain opened this issue Jan 18, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@stefancrain
Copy link
Contributor

Error

Traceback (most recent call last):
  File "/usr/bin/holiday_exporter.py", line 55, in <module>
    if date.fromisoformat(isodate) == date.today():
ValueError: Invalid isoformat string: '2020-1-01'

Using included yaml config (problem line)

...
  - date: "{YYYY}-{MM}-01"
    description: "Some event that repeats every month at specific day"

Isodate expects {MM} but now.month only gives us 1 causing the failure above.

 isodate = custom_holiday['date'].upper().format(YYYY=now.year, MM=now.month)
@allangood
Copy link
Owner

Thank you for bring this issue!
I'm working in the fix and it will be available soon.

@allangood allangood added the bug Something isn't working label Feb 5, 2020
@allangood
Copy link
Owner

This bug is addressed on #3
Thank you very much for your collaboration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants