andreasgerstmayr / fava-dashboards

Custom Dashboards for Beancount in Fava
MIT License
176 stars 21 forks source link

Get start and end date of date range selected #78

Closed simonhughxyz closed 3 months ago

simonhughxyz commented 3 months ago

It would be useful to get the start and end date of the date range selected in fava. This would be particular useful for projections. I.e. project until the end of a date range.

I am not sure if there is already a way to do it, but I could not find a way.

andreasgerstmayr commented 3 months ago

Hi Simon,

you can use ledger.dateFirst and ledger.dateLast. It's documented here: https://github.com/andreasgerstmayr/fava-dashboards?tab=readme-ov-file#configuration

simonhughxyz commented 3 months ago

Hi Simon,

you can use ledger.dateFirst and ledger.dateLast. It's documented here: https://github.com/andreasgerstmayr/fava-dashboards?tab=readme-ov-file#configuration

Hi, thanks for replying and helping.

I'm trying to get the first and last date selected. ledger.dateFirst and ledger.dateLast only seem to return the first and last transaction, but not the selected date range.

For example: I want to calculate a projection on the amount of tax I have to pay by the end of the tax year, when selecting the FY2025 tax year, ledger.dateLast will only return the last transaction not the end of the tax year.

andreasgerstmayr commented 3 months ago

You're right. I've added the filter dates in #80

simonhughxyz commented 3 months ago

Thank you for your awesome work