Loading...
 
Features / Usability

Features / Usability


Can you use >= or <= for PluginList date filters?

posts: 24 Australia

Hi all,

We just got a requirement for PluginList that instead of filtering for all items that are expiring in the next 30 days, ie.

{filter range="tracker_field_REG_ExpiryDate" from="now" to="30 days"}


We now need something like have today's date between one variable (REG_ReminderDate) and another variable (REG_ExpiryDate)

Is there any way to have a filter that "now" is:

>= tracker_field_REG_ReminderDate

And

posts: 24 Australia

Ok I don't know why it's cutting off half my message but here's the rest of it:

Is there any way to have a filter that "now" is:

Greater than or equal to tracker_field_REG_ReminderDate

And

Less than or equal to tracker_field_REG_ExpiryDate

Edit: using this doesn't really work but it's one step forward (ie. if both dates are in the past it shows it anyway. So it doesn't really show dates within a date range per se) :

{filter range="tracker_field_REG_ReminderDate" from="now" to_field="tracker_field_ExpiryDate"}


BUT

it comes out with the following error messages - is there a way to ignore / suppress the error messages?

The range filter is missing \"from\" or \"to\". filterRange: "to" value not parsed
posts: 24 Australia
Bernard Sfez / Tiki Specialist wrote:

Hello Leena,

I don't have to dig in your issue, but I recall having a similar issue.
Solved with "midnight"

{filter range="tracker_field_productsboughtDate" from="first day of previous month midnight" to="first day of midnight"}


https://doc.tiki.org/PluginList-filter-control-block#Date_ranges


Thanks Bernard,

Not quite what I was looking for but that's fine.

For me, the expiry date and reminder dates can vary - one expiry may have a reminder 1 week out and another may have it 30 days out, hence the need to be dynamic. If this feature is not available that's fine, I'll look at other avenues.

Thanks

posts: 126825 United Kingdom
Leena wrote:

Is there any way to have a filter that "now" is:

Greater than or equal to tracker_field_REG_ReminderDate
And
Less than or equal to tracker_field_REG_ExpiryDate


Hi @lkganguli@gmail.com

I think you can do this with a Maths Calculation Field if you add a "valid duration" field instead of the exact expiry and make the exact expiry date the calculation - i don't fully follow your field names but might something like this work?

  • StartDate (Datetime field)
  • ValidDuration (maybe one of the new Duration fields?)
  • ExpiryDate (Calculation field which is set to be the Start Date plus the Duration)


and then filters like:

{filter range="tracker_field_StartDate" from="now" to="2 years"} {filter range="tracker_field_ExpiryDate" from="2 years" to="now"}


(i'm using "2 years" to mean "forever")

Would need a load of fiddling with, and this is all untested and just made up, but i think that's how i would go about it.

It may not be any good for your timezone but we could have a go at it at the end of Roundtable Meeting 2022 06 if you're keen maybe?

posts: 24 Australia
Jonny Bradley wrote:

Hi @lkganguli@gmail.com

I think you can do this with a Maths Calculation Field if you add a "valid duration" field instead of the exact expiry and make the exact expiry date the calculation - i don't fully follow your field names but might something like this work?

...
Would need a load of fiddling with, and this is all untested and just made up, but i think that's how i would go about it.

It may not be any good for your timezone but we could have a go at it at the end of Roundtable Meeting 2022 06 if you're keen maybe?


Thanks Jonny,

I will try it out and see where I get to :-)

Unfortunately I won't be able to make it to the roundtable meeting but thank you for the invite.

Cheers