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

When time filter is selected, fava-envelope will not work #32

Open
czszj opened this issue Aug 11, 2021 · 1 comment
Open

When time filter is selected, fava-envelope will not work #32

czszj opened this issue Aug 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@czszj
Copy link

czszj commented Aug 11, 2021

I selected 2021 in the time filter box, fava-envelope will not work. following is the screen shot
image

The exception is:
File "/home/jason/miniconda3/lib/python3.9/site-packages/fava_envelope/modules/beancount_envelope.py", line 48, in init
self.date_start = datetime.datetime.strptime(self.start_date, '%Y-%m').date()
TypeError: strptime() argument 1 must be str, not None

@polarmutex polarmutex added the bug Something isn't working label Aug 11, 2021
@egetzner
Copy link
Contributor

This issue is due to the way the plugin is dependent on the "start date" entry, which is bound to the date at the beginning:

2010-01-01 custom "fava-extension" "fava_envelope" "{}"
2010-01-01 custom "envelope" "start date" "2015-01"

Here you would get an error for each filter that would exclude this 2010-01-01 date (even though the budget starts in 2015).

I propose to move the start date to the options like so:

2010-01-01 custom "fava-extension" "fava_envelope" "{'start_date':'2015-01'}"

Potential downside: for the multi-currency version, it would mean that all currency budgets share the same start date.

We could just leave both of these, having the options: start_date as a fallback if no custom "envelope" "start date" entry exists in the current filter.

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

3 participants