Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Datetime-local - filter Topic is solved
-
- Posts: 315
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 87 times
- Been thanked: 11 times
Datetime-local - filter
I have a launch form that filters a table below with the date which is a date field. The table below contains a datetime-local because I need the time. When I filter with the current date the liste below is empty : I have to create a second field containing the date only. Is there another way to perform this operation ?
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
-
- Posts: 315
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 87 times
- Been thanked: 11 times
Re: Datetime-local - filter
It's filter by acc_date which is a date and not a datetime
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Datetime-local - filter
What date format has acc_date? You might have to convert it to the format yyyy-mm-dd when passing it in nuFilterRun()
-
- Posts: 315
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 87 times
- Been thanked: 11 times
Re: Datetime-local - filter
acc_date is in 'dd/mm/yyyy format'. I will try by changing the format.Format of the DateTime in tache_iframe is 'dd/mm/yyyy hh:nn' with is the same as acc_date. Do you think that the system doesn't take those formats into account but works with the default format for the search ? I will try. Thx
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Datetime-local - filter
Try with a static date value like nuFilterRun('tache_iframe','2022-04-03') to see if the iFrame is refreshed. Then you know if the date needs to be in that format.
-
- Posts: 315
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 87 times
- Been thanked: 11 times
Re: Datetime-local - filter
If I change nuFilterRun('tache_iframe', '#acc_date#') by nuFilterRun('tache_iframe','2022-04-13') in order to filter on the 13th of april, it doesn't work. Could you please explain how the filterRun works on dates ?
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Datetime-local - filter
nuFilterRun() adds a WHERE clause in your SQL. When you inspect the generated SQL (Option Menu, Form Info) you will see an sql like
If you convert your date format from dd/mm/yyyy to yyyy-mm-dd, the filter should just work fine.
Code: Select all
SELECT your_table_id, your_date_column FROM your_table WHERE 1 AND CONVERT(your_date_column USING utf8) LIKE "%2022-04-16%") )
Code: Select all
let arr = this.value.split('/');
nuFilterRun('tache_iframe',arr[2] + '-' + arr[1] + '-' + arr[0]);
You do not have the required permissions to view the files attached to this post.