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

use parseDate() instead of date() #7

Open
fritzmg opened this issue Dec 22, 2014 · 0 comments
Open

use parseDate() instead of date() #7

fritzmg opened this issue Dec 22, 2014 · 0 comments

Comments

@fritzmg
Copy link

fritzmg commented Dec 22, 2014

The document templates use the regular PHP date() function, e.g.

<?php echo $this->collection->locked ? date($GLOBALS['TL_CONFIG']['dateFormat'], $this->collection->locked) : date($GLOBALS['TL_CONFIG']['dateFormat']); ?>

However, this will result in the wrong translation for day and month (if such a date format is used). It would be better to use Contao's parseDate function:

<?php echo $this->collection->locked ? $this->parseDate($GLOBALS['TL_CONFIG']['dateFormat'], $this->collection->locked) : $this->parseDate($GLOBALS['TL_CONFIG']['dateFormat']); ?>
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