Question about dates

Hey forum,

I can’t figure out how I can check the differences between dates, if I retrieve them from a API.

Aangeboden sinds = offered since
Verkoopdatum = sale date
Looptijd = period of when it is offered vs sold

I want to know how many days there are between the published date vs sold date. (They are formatted as text, not as dates so I dont know how I can minus these from each other.)

Thanks :wink:

Ah i see, here I can change the format. But I only since the value “aangeboden” since, and not “verkoopdatum” here. Any idea how I can fix this?

Thanks in advanced.

Jona

Looks like to me you can change the format for all of the different fields in your screen shot…just look to the right and you can see a dropdown for each field

Yes, but if change these to “date” wil also the “Verkoopdatum” value change to a date field instead of text?

The data you see in small light grey font is just a tip for better human readability.
(Bubble takes 1 object in your JSON and displays its data just for readability.)

This API answer is weird as all field are not consistent. The “value” is sometime a date but sometime a date-period (“2 weken”).

Will this be frequent for you to receive “value” that are not only dates?

Yes, the goal is to know how many days are between the publishing date and the sold date.

But what I find weird is that the “Aangeboden sinds” is getting there as a date now, but the “Verkoopdatum” is not.

Yes, if you change the value in the dropdown from text to date, all returned values will be available as the type of data you set on the dropdown…if value=date and name=text ALL names will be text and ALL values will be dates.

Ah check, I did that couple minutes ago and it seems working but I can’t see the sold date here. Any idea?

Schermafbeelding 2024-04-09 om 15.14.57

Here it also does not return, but when I initialize the api it is getting returned. Heh?

On other URL’s it is working… I dont get it

Hard to tell if you are working with the same data from the other URL and the screen shots you shared…in one it shows a date of Jan 25, 2023

Screen Shot 2024-04-10 at 12.24.21 AM

While screen shot shared from what is supposed to be it working on other URLs does not have the date of Jan 25, 2023

Which would make me assume you are not looking at the same data between the two different URLs.

I would venture to guess the reason why you do not see a value for the date on the Verkoopdatum is because it was not sold and that might be whey the date value is empty.

All bubble does is accept the payload and shows the values that were sent from the API provider…have you checked the database from the API provider to see what is the sold date for Verkoopdatum?

This topic was automatically closed after 70 days. New replies are no longer allowed.