Date/time problem with French format

Hi everyone,

I noticed that I have a little problem with my app. Basically, an admin can create events, and people can receive a mail when they can grab a spot for the event. When creating the event, there is date/time pickers for 2 things : the day when they can save a spot, and the event itself.

When I’m picking dates, the date/time picker is showing dates in a French format : dd/mm/yyyy.
But, there is the problem : when I’m using this data in the app, the app will consider it as a US format date : mm/dd/yyyy.

Is there any settings allowing me to change from US to French format ? Or can Glide automatically use a locked format for dates in the app ?

Thanks

2 Likes

@Daniel_Sweet would this benefit from the new date handling? Can we enable it for @MaximeDeconinck?

1 Like

Yeah, this seems like it would be solved with our experimental new date code.

@MaximeDeconinck We tried enabling a fix a few weeks ago, but this broke a bunch of apps and we had to revert it. We’re still working on testing it unfortunately. I recommend that you enable date formatting in the data editor for the time, this will correct your date problem immediately.

Well, I think that I’m already using it…

So I don’t really know where the problem is coming from.

@MaximeDeconinck Can you share a support code with me on the forum? Only authorized Glide employees can access your app through these support codes, so feel free to post here or DM me.

1 Like

There you go : https://go.glideapps.com/support/622404ad-d243-42c9-8923-9f18131fc83f

@MaximeDeconinck Who are you previewing as? I can’t seem to get to the page in question.

I’m previewing as myself on the app, because only admins can create events.

I can’t seem to reproduce this on my own. Looking into your app internally, it seems that the date is actually correct. We sent the correct date to our own backend. I do see that the row in question has been updated lately. Is this still a problem as of the recent reload?

The problem is still there, but I think I just found something really interesting.

You probably saw it, but I’m using a details layout, an inline list with a calendar layout instead of just a regular calendar layout, but when I switch to the calendar layout, it appears that dates are know understood in a French format, which is really weird actually…

Maybe the problem is coming from the fact that it is an inline list that only uses US dates format (just guessing) ? I can’t really go for a regular calendar layout, because I’m using others components on this page, such as a link to the event’s creator.

Ah. I see what you mean.

The problem is that you are combining the date and the hour as text. You should consider finding an alternative to doing so, as date and time formats vary wildly from one computer to the next. Defaults for web browsers, regardless of localization settings, treat all attempts to read textual dates as US format. Trying to base this on localization is extremely fragile and will likely break.

Consider instead storing your data as a combined Date/Time format. You can control the format individually using the Math column; for Dates just refer to the combined Date/Time column, and for the Hour you may use our new HOUR() function over the same Date/Time column.

4 Likes

I see, I’ll try that.

Small problem, I can’t access my app anymore (Could not load network resources), can you ?