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

Added lang parameter for date variables in templates #920

Open
wants to merge 1 commit into
base: 7.dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/templates/date-variable-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ The `timezone=` parameter will convert a date to the specified timezone:

This will override the timezone specified in the [localization settings](control-panel/settings/general.md) in the control panel, and the member's localization settings. PHP.net has a [list of supported timezones](https://php.net/manual/en/timezones.php).

### Translating Dates

By default, the dates are shown according to user preferred language or the system language. You can override this by using the `lang=` parameter:

lang="french"

Please note that the [language file](localization/languages.md) must be present in the `system/user/language/` directory. If the language file is not found, the date will be displayed in the default language.

## Date Formatting Codes

These are all the available formatting codes. If you are familiar with PHP, then these will look [remarkably similar](https://php.net/manual/en/function.date.php#refsect1-function.date-parameters):
Expand Down