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' #13440

Conversation

magnolia61
Copy link
Contributor

Overview

Addred freeform relative date filter fot 'This Fiscal Year'

Before

Only hardcoded relative date filter was possible for This Fiscal Year

After

Also This and last 1,2,3,x fiscal years is possible
this_1.fiscal_year, this_2.fiscal_year, this_x.fiscal_year

Technical Details

Based on other work being done in #12682

Comments

Works like a charm

@civibot
Copy link

civibot bot commented Jan 12, 2019

(Standard links)

@eileenmcnaughton
Copy link
Contributor

@magnolia61 there is an IF clause here being opened but not closed - hence all the errors.

On the philosophy of this - I'm not sure what 'this_2.fiscal_year means.

I can see that 'ending' is the last thing we expanded the definition of & we got

'last 90 days including today' and I'm assuming that you think that doesn't make sense because 'today' isn't a complete fiscal year. But I'm not 100% sure if this.2_fiscal_year is 'last 2 fiscal years ending at the end of this fiscal year' or '2 fiscal years before this one. If you mean the later then previous_2_fiscal makes sense. If you mean 'last 2 fiscal years including this one' I'm torn between thinking maybe 'ending' is appropriate if we understand ending not as 'ending today' but 'ending at the end of this fiscal year' & thinking we want a new term. At this stage expanding 'this' seems kinda confusing to me

this.day Today
this.week This week
this.month This calendar month
this.quarter This quarter
this.fiscal_year This fiscal year
this.year This calendar year
previous.day Yesterday
previous.week Previous week
previous.month Previous calendar month
previous.quarter Previous quarter
previous.fiscal_year Previous fiscal year
previous.year Previous calendar year
ending.week Last 7 days including today
ending_30.day Last 30 days including today
ending_60.day Last 60 days including today
ending_90.day Last 90 days including today
ending.year Last 12 months including today
ending_2.year Last 2 years including today
ending_3.year Last 3 years including today
starting.day Tomorrow
next.week Next week
next.month Next calendar month
next.quarter Next quarter
next.fiscal_year Next fiscal year
next.year Next calendar year
starting.week Next 7 days including today
starting.month Next 30 days including today
starting_2.month Next 60 days including today
starting.quarter Next 90 days including today
starting.year Next 12 months including today
current.week Current week to-date
current.month Current calendar month to-date
current.quarter Current quarter to-date
current.year Current calendar year to-date
earlier.day To end of yesterday
earlier.week To end of previous week
earlier.month To end of previous calendar month
earlier.quarter To end of previous quarter
earlier.year To end of previous calendar year
greater.day From start of current day
greater.week From start of current week
greater.month From start of current calendar month
greater.quarter From start of current quarter
greater.year From start of current calendar year
less.week To end of current week
less.month To end of current calendar month
less.quarter To end of current quarter
less.year To end of current calendar year
previous_2.day Previous 2 days
previous_2.week Previous 2 weeks
previous_2.month Previous 2 calendar months
previous_2.quarter Previous 2 quarters
previous_2.year Previous 2 calendar years
previous_before.day Day prior to yesterday
previous_before.week Week prior to previous week
previous_before.month Month prior to previous calendar month
previous_before.quarter Quarter prior to previous quarter
previous_before.year Year prior to previous calendar year
greater_previous.week From end of previous week
greater_previous.month From end of previous calendar month
greater_previous.quarter From end of previous quarter
greater_previous.year From end of previous calendar year

@magnolia61
Copy link
Contributor Author

magnolia61 commented Jan 14, 2019

Our fiscal year, also our season is both used for the contributions as well as the registrations. Our Fiscal Year is from October 1st until September 30th.

We use a Certificate of Good Conduct that people have to renew every 3 years/seasons (we only have summer camps). So our use case is a smart group of all Conduct that are still valid.
For this we need a smart group that includes the Current Fiscal Year and the previous two.

For this year it would need to be from October 1st 2016 until September 30th 2019).

I must admit that wanting the end date of the smart group be the end of the fiscal year instead of 'today' has to do with problems with smart groups that stalled to become static using hard coded dates instead of relative ones the last couple of years.

Would the logic behind ending_2.fiscal-year lead to the range starting October 1st?

My thinking would be it would fit best with 'This' as is has the current week, month, year with the days past and also the days to come. And add the previous. But it would not apply to this and the next two for instance.

Maybe this_before_2.Fiscal Year and this_next_2.months which would be in line with some existing ones?

@magnolia61
Copy link
Contributor Author

The before_x.fiscal_year that @luciano_s proposed in the dev channel would actually be partly a solution for our use case. It would be able to find dates older than within the current and previously two fiscal years.

Our current workaround will be a smartgroup that consist of a combination of 'Prevous 2 Fiscal years' and 'This Fiscal Year'.

@magnolia61 magnolia61 force-pushed the Fiscal_Year_Freeform_Relative_Date branch from 9b6b54d to 108c27b Compare January 15, 2019 16:15
@colemanw
Copy link
Member

@civicrm-builder retest this please

@magnolia61 magnolia61 force-pushed the Fiscal_Year_Freeform_Relative_Date branch 2 times, most recently from a8cc4bd to 89aa667 Compare January 23, 2019 23:27
@eileenmcnaughton
Copy link
Contributor

I put up an amended version of this - with the tests #14894

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.

3 participants