date sent from calendar ui have different format

gix.vax 26 Feb, 2023
HI all

i have a form in popup to edit data of a table list view
save is ok but my calendar have a strange behaviour

if i save calendar field from first line of table view, the value is passed correctly and it save 01/02/2023 ok
if i save from second line, or third etc it invert month and day and when it saves give me an error or save month and day inverted if day is under 12 month
it saves mm/dd/yyyy end not dd/mm/yyyy
i try a lot of things
{date/Europe/Rome:mydate}
{date/Europe/Rome:Y-m-d H:i:s$(data:mydate)}
with / ot - inverting m and d...
playing with format but i can't understand why first line is passed correctly and from second it invert month and day

someone have the right way to save directly?
i excpet that if i send a calendar, i don't have to manage date.

i can't understand.
firts row save 09/02/2023
other rows save 02/09/2023
month and day inverted
gix.vax 27 Feb, 2023
if i try to save a date not compatible with month (eg. number 27 of date 27/02/2023 the error in console is this

DateTime::__construct():: Failed to parse time string (27/02/2023) at position 0 (2) : Unexpected character

if i save from first row it doesn't happen (using the same date), only from second, third fourth etc.

The field for date is only one (the same for first and other rows)
i can't see difference from first and other rows
my date is in a popup that save without problem except with calendar date

Someone can help me?
A workaround?
(i need a calendar in this field)
gix.vax 27 Feb, 2023
if in calendar field i set

Display Format = YYYY-MM-DD

it works

but i need to show date in DD/MM/YYYY format

Someone can help me?
Elita- 13 Mar, 2023
hi, gix.vax,
is this a question on how you date appear in the CCv6 table?

It depends on how the data is stored in db. Better is to store date as DATE in MySQL, not text or varchar - in format YYYY-MM-DD since thet is the proper format of a DATE im MySQL database.
Then for a table view just use date conversion function in Table "columns views":

Model.date = {date:d/m/Y$(var:data_table.row.Model.date)}
gix.vax 13 Mar, 2023
thank you Elitakey

I know MySQL and show format and CC6 synthax for date

my problem is strange
i have my date in mysql YYYY-MM-DD HH:MM:SS format

my field show DD/MM/YYYY (in Italy we use this format) and is set to save in mysql format YYYY-MM-DD

the strange thing is this

Date field is in a popup that appear clicking a button in a table list view
if i click the button on the first row, it show correctly and save correctly
if i click the button in second or third or fourth etc in table list view, it show correctly but when save it give error cause try to invert MONTH and DAY
eg. if i save a date 08/03/2023 where 8 is day and 3 is March it save 03 for day and 08 for month (in db i have 2023-03-08 00:00:00)
It happen only from second record of my table list view
You need to login to be able to post a reply.

VPS & Email Hosting 20% discount
hostinger