By editing a record with the erditor the datefields are empty

By editing a record with the erditor the datefields are empty

zerennerzerenner Posts: 16Questions: 6Answers: 0

Good morning,

i have a table with 2 date fields. If i create a new record all is o.k.and the database has saved the dates.![]

If i wan´t to update with editor form the date fields are empty. Can you help was is wrong? (the used extension for kundenurlaub is phtml)..

Thanks for your help

Dirk

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    In the Javascript you are using:

    type: 'date',
    format: 'D mm YYYY',
    

    For date inputs, I would suggest you use the datetime field type rather than date. The single exception to that is if you already have jQuery UI date picker on your page (I'm not sure if that is the case or not here).

    In your PHP you have:

    ->getFormatter( Format::dateSqlToFormat( 'd-m-Y' ) )
    

    Two things here:

    1. There is no setFormatter which there should be unless you use ISO8601 everywhere.
    2. The date format given for the get formatter is different from the one used in the Javascript. Which is the correct one? They should match.

    Allan

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    Hi Allan,

    thank you very much. Now it works how i want :)

This discussion has been closed.