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

Add freeform relative date for 'This Fiscal Year' #14894

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Added support for this_n.year & this_n.fiscal_year

Before

No support for 'Last year & this year' or 'Last fiscal year & this fiscal year' ('These 2 years')

After

Support at the code level - as with #12682 it is necessary to add an option value to the relative_date_filters custom group to expose any new options

Technical Details

@magnolia61 I decided to add a test for yours to finish it - but I found I had a slightly different assumption ie

this_2.fiscal_year = 'these 2 fiscal years' - ie. last year & this year. I think your assumption was that this_2 would actually be 2 years.

Comments

@civibot
Copy link

civibot bot commented Jul 27, 2019

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

@MegaphoneJon is this one you can look at?

@magnolia61
Copy link
Contributor

Just returned from a holiday. Will look into this later today.

@eileenmcnaughton
Copy link
Contributor Author

@MegaphoneJon @magnolia61 can I get you to check this out?

@magnolia61
Copy link
Contributor

magnolia61 commented Oct 21, 2019

I was finally able to look at this. The mechanics work fine and as expected.
The results are the following, with a fiscal year that starts September 1st:

this.fiscal_year   (01-09-2019 - 31-08-2020)
this_1.fiscal_year (01-09-2019 - 31-08-2020)
this_2.fiscal_year (01-09-2018 - 31-08-2020)
this_6.fiscal_year (01-09-2014 - 31-08-2020)

The labels in the options would correspond like this

this_fiscal_year   - This fiscal year
this_1.fiscal_year - This fiscal year
this_2.fiscal_year - This and previous fiscal year
this_6.fiscal_year - This and previous 5 fiscal years (note 5 here, not 6)

Indeed I used the names differently before (this_1.fiscal_year for this and 1 previous). But I think what you propose is more logical.
We currently only had a need for flexible Fiscal Year relative dates, but I can see this mechanism also work for "This and previous calendar year" (+ week, month, quarter) :-)

@eileenmcnaughton
Copy link
Contributor Author

Merging based on @magnolia61 review - thanks of that!

@eileenmcnaughton eileenmcnaughton merged commit 2f56b87 into civicrm:master Oct 21, 2019
@eileenmcnaughton eileenmcnaughton deleted the date_fisc branch October 21, 2019 11:39
@eileenmcnaughton
Copy link
Contributor Author

this_6.fiscal_year - This and previous 5 fiscal years (note 5 here, not 6)

Or 6 most recent fiscal years (including the current one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants