Page 1 of 1

Date for UK table view

Posted: 2021-01-06 17:21
by mqley
Hi, I've had a good look in the forum but can't find a solution.

I'm trying to switch the date from USA: 01/06/2021 to UK: 06/01/2021 - how would one go about this? Thanks

Re: Date for UK table view

Posted: 2021-01-06 18:05
by pbottcher
Hi,

maybe this helps.

viewtopic.php?t=1758

Re: Date for UK table view

Posted: 2021-01-06 23:35
by mqley
Thanks very much, I'll have a go tomorrow.

Re: Date for UK table view

Posted: 2021-01-07 10:50
by mqley
Hi, thanks again. Turns out just changing from the date_format function code from '%m/%d/%Y' to '%d/%m/%Y' does what I need. I didn't require the line 'sql("SET lc_time_names = 'en_GB'", $eo);' in _global.php

The change was in 'root> yourtablename_view.php (3 instances changed).

Leads to another question - will this get written over with next build? If so what's the best solution to avoid?

Regards

Re: Date for UK table view

Posted: 2021-01-07 16:01
by pbottcher
Hi,

yes that will be overwritten if you regenrate your app.
You can make that file read_only, but need to remember if you have changes to that table, you will need to allow overwriting that file and applying the changes again.

Re: Date for UK table view

Posted: 2021-01-07 17:23
by mqley
Ok thanks. I'll make a note. Thanks very much.

Re: Date for UK table view

Posted: 2021-01-07 17:35
by pfrumkin
You could change the Data Format for each column using the AG UI. That way it would persist, but of course that may be more tedious if you have a lot of date columns. It is easy to add a data format if the one you want isn't there. Looks like the UK date/time is there but not just date. I added US Short Date very easily.

~Paul