Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the latest Submission Date #157

Open
kaspar-allenbach opened this issue Sep 13, 2017 · 0 comments
Open

Get the latest Submission Date #157

kaspar-allenbach opened this issue Sep 13, 2017 · 0 comments

Comments

@kaspar-allenbach
Copy link

Not sure if this is a plugin issue:

I want to get all the submissions like this:

{% set latestSubmission = craft.amForms.submissions(
    { formHandle: 'reservation', order: 'dateCreated desc' }).datum('>= '~now).dateCreated().first()
%}

{{ latestSubmission }}

this outputs:

Do., 07 Sep. 2017 10:32:05

Now when I want to formate date for example let's say:

{{ latestSubmission | date('m.d.Y') }}

There is a error:

DateTime::__construct(): Failed to parse time string (Do., 07 Sep. 2017 10:32:05) at position 0 (D): The timezone could not be found in the database

It seems as if the outputed time string is no longer valid when applying the date filter. Could it be that am forms saves the timestamp in the wrong format in the db?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant