filtering on dates

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
angus
Veteran Member
Posts: 128
Joined: 2020-05-28 22:27

filtering on dates

Post by angus » 2022-03-07 14:41

Hello everyone, I have a field in my table called 'Date' and people are filtering on this ok. what I want is to create another filter field based on this date but the user only searches on the month.

I added the following into the _view.php page.

Code: Select all

"date_format(`PlannedGames`.`Date`,'%M%Y')" => "MMMYYYY",
Unfortunately this isn't working.

when I use just the month and filter Date like Feb it works ok. but not when I add the year, any idea?

Code: Select all

"date_format(`PlannedGames`.`Date`,'%M')" => "MMM",
AppGini 22.13

angus
Veteran Member
Posts: 128
Joined: 2020-05-28 22:27

Re: filtering on dates

Post by angus » 2022-03-11 21:44

I found the issue, %M is for the full month and not the 3 letter month like APR for April. I changed it to

Code: Select all

"date_format(`PlannedGames`.`Date`,'%m%Y')" => "MMMYYYY",


and I can search by 042022 now.
AppGini 22.13

Post Reply