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

[Tng] Format timestamp attribute #12

Closed
PaoloB opened this issue Jul 31, 2014 · 10 comments
Closed

[Tng] Format timestamp attribute #12

PaoloB opened this issue Jul 31, 2014 · 10 comments
Assignees
Milestone

Comments

@PaoloB
Copy link

PaoloB commented Jul 31, 2014

Hi,
i have update my MetaModels to TNG version.

I have a timestamp filed on my application.
If I insert a new record or update a record, I have this error:
DateTime::__construct(): Failed to parse time string (24/05/2014) at position 0 (2): Unexpected character

The date is 24/05/2014

In Contao the date format is d/m/Y
if the date is similar to 05/10/2013, the error is not present
I think it's a problem with the date format.

@tim-bec
Copy link
Contributor

tim-bec commented Aug 11, 2014

@PaoloB
Copy link
Author

PaoloB commented Aug 12, 2014

I did a test.
I changed the format of the date in d-m-Y and now it works.
It seems to be the character /

@MacKP
Copy link

MacKP commented Aug 12, 2014

Ah.. i think u need to escape it like that -> 05/10/2013
Can you test it pls?

regards

@MacKP MacKP closed this as completed Aug 12, 2014
@MacKP MacKP reopened this Aug 12, 2014
@PaoloB
Copy link
Author

PaoloB commented Aug 12, 2014

I have reset the configuration in d / m / Y
Handwriting the date 18/06/2014 you receive the same error

DateTime::__construct(): Failed to parse time string (18\/06\/2014) at position 0 (1): Unexpected character

@stefanheimes
Copy link
Member

Try MM/DD/YYYY and not DD/MM/YYYY . By the way the contao config is not used here.

@PaoloB
Copy link
Author

PaoloB commented Aug 12, 2014

Should I try to enter a date in that way or to change the date format in the general settings?

@stefanheimes
Copy link
Member

Please enter a date in this format. As i say the config from contao has no effect.

@PaoloB
Copy link
Author

PaoloB commented Aug 12, 2014

Is not correct,
the configuration of Contao is read

I tried it and I am given the error to enter a date in the format DD / MM / YYYY

@stefanheimes stefanheimes added bug and removed question labels Aug 14, 2014
@stefanheimes
Copy link
Member

Problem understood and accepted. You are right. The widtget itself use the contao settings. So it is easy to add this information to the attribute class. I hope this will fix the problem.

@stefanheimes stefanheimes self-assigned this Aug 14, 2014
@discordier discordier added this to the 2.0.0 milestone Sep 23, 2014
@discordier
Copy link
Member

See contao/core#7721

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

No branches or pull requests

5 participants