Date-Format in Save Data

Fredolino 02 Jul, 2019
Hello,

I have a date with this format:
{date:Y-m-d $(var:read_beob.Fund.datum)} (for example, 11.6.2019).
If I want to save a new record with this date later
the date in the database must again have the format Y-m-d with "Save Data".

What do I have to enter in Data overrides?

datum | {data:Fund.datum} | on insert
is not right

Fund.datum | {date/data: read_beob.Fund.datum: Y-m-d} | on insert
is not right

Other variants I have tried but either is in the database only 0000-00-00 or it comes the message: "... can not by 0".

Thanx
F.
healyhatman 02 Jul, 2019
The example you gave doesn't match the format you gave in your code.

{date:FORMAT$(param)}

You see the part in your shortcode where you have Y-m-d ? That would be why it's coming up in Y-m-d. You want d.m.Y but honestly I would keep it STORED as Y-m-d and then just display it however you want.
Fredolino 02 Jul, 2019
Hi :-)

in the database I always save the date in the format: Y-m-d.

In the frontend I show this date like this:
{date:Y-m-d $(var:read_beob.Fund.datum)}

If I want to save a new record with an edit form later, but with the same date as the records already saved?

So the date from "read_beob.Fund.datum" from "Read Data"
in the format Y-m-d has to be saved in Save Data ….
healyhatman 02 Jul, 2019
Okay so you save as Y-m-d , and you display it in Y-m-d..... What's the problem I don't understand
healyhatman 02 Jul, 2019
So are beobs related to beofs? And if so why so they need their own date, why wouldn't the date be with the primary record? And look at your debug - when saving does data:Fund.datum even exist? Because unless it's in a field somewhere on your page I bet it doesn't.
healyhatman 02 Jul, 2019
Ok so in your first image I don't see a date field anywhere? No fund.datum ? So where are you trying to get the date from and again should the date be associated with beof or beob?
healyhatman 02 Jul, 2019
Okay so then if you get the date from a read data, then you need to read the data again and use the read date. Which again suggests to me that the date is being associated with the wrong property, if in fact all the observations on that list have the same date?
Fredolino 02 Jul, 2019
That's the only way I could link 2 Read Data and map the records.
The lists are correct so far. I could not find a problem.

Even if I enter the "{var: read_beob.Fund.date}" in Save Data, it does not save the date in Y-m-d ...
healyhatman 02 Jul, 2019
Does it save the date at all? Does read_beob.Fund.date have a value?
Fredolino 02 Jul, 2019
where exactly do I have to enter {debug:} for control?
healyhatman 02 Jul, 2019
Anywhere in the event after everything else
Fredolino 02 Jul, 2019
You're right. The debug shows me:
Because there is no date for the beof_id dataset, 0000-00-00 is entered in the database.

But I have in the view event-tab  in the headline:
<h3 style = "font-weight: 300; color: # 71a26a">
{date: d.m.Y $ (var: read_beob.Fund.datum)}: {var: read_article.Article.fundort} </ h3>

If I could transfer and save the date in Y-m-d format, everything would be fine.
But that does not work?
healyhatman 02 Jul, 2019
Answer
1 Likes
Not like that it doesn't. Put it in a hidden field or read it from the database as again
This topic is locked and no more replies can be posted.