Hello, I’m new to weweb and I’m stuck on a date formatting issue.
Let me explain: I have a projects table that pulls data about projects, including a project start date. I want users to be able to filter the table data by adding a date range to keep only the projects that fall within that range. So I used a date picker. I have a comparison problem when comparing dates with each other. I think it’s due to the date format but I don’t know how to solve this problem.
When I make comparisons, 12/01/2024 > 07/02/2024 (probably because 12>7). Could you help me?
Thank you for your response. I think I have identified my problem. In my data collection, the date_debut field doesn’t seem to return the correct date. In Supabase, I am using the date format. My first project has a start date of January 12th.
It displays correctly in my table
But when I use the date() function, it returns a date that is not January 12th. I don’t understand why.
I would like to be able to filter the table data based on the user’s choice (who selects the date range to display projects that started during that period)
Any idea what I’m missing?
edit : The issue came from Supabase. The table data came from a Supabase view. In this view, I had requested to transform dates from yyyy-mm-dd format to dd/mm/yyyy format. I modified that and now it works. Thank you!