How do I get actual Date objects in a collection?

I’m attempting to create a collection from a supabase table, and the Date field always appears as a Text value in WeWeb. From what I’ve read of the documentation, this happens if there’s null values in the Date column of the database, but I’ve verified that there are no null values.

What am I doing wrong here? Not having an actual date type for the collection is making any kind of sorting or filtering really difficult.

Hi Malthanis, welcome to the community :waving_hand:

What do you mean by a “date field”, all dates are interpreted as text, specifically as an ISO 8601 string (e.g., ‘2025-11-04T16:08:00.000Z’), rather than as native JavaScript Date objects.

How do you intend to use this data? for example, do you want to display it with a date picker or date selector in your app?

If your date values are stored as ISO strings, you can pass them directly to date input elements or date pickers in WeWeb. Most date selector components are designed to accept ISO 8601 strings and will properly interpret them as dates.

Sorting and filtering should ideally be handled in the backend. For the display, you can use the string values and format them as you wish either using javascript or by adding the Date extension and using the formulas

@Malthanis

I have experienced this many times, too. When you ask GPT it sais, that this is a known issue within the weweb community.

I sorted it in a way that i managed all filtering with a supabase view - where ever its possible… I have experienced that this “data type mapping issue” can occure out of the nowhere and then the collection is screwed :confused:

The display of the data is currently irrelevant. I need to be able to do proper sorting and filtering on dates for an order tracking system.

I’m unsure if your team made some kind of update to the system, but I’m now seeing proper greater/less than operators available for filtering/sorting on collection Date fields, even though they’re set as text.

What was the thought process behind not using the Date object type?

Can’t do that on the back-end, the collection data needs to be manipulated by the end-user.