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

update documentation #4

Merged
merged 1 commit into from
Aug 2, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Resources/doc/reference/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ retrieved by using the session instance.

.. code-block:: twig

{% format_date date_time_object %} => '30 nov. 1981'
{% format_time date_time_object %} => '02:00:00'
{% format_datetime date_time_object %} => '30 nov. 1981'
{{ format_date(date_time_object) }} => '1 août 2011'
{{ format_time(date_time_object) }} => '19:55:26'
{{ format_datetime(date_time_object) }} => '1 août 2011 19:55:26'

The second argument can be used to use a specific pattern :

.. code-block:: twig

{% format_date date_time_object, 'dd MMM Y G' %} => '30 nov. 1981 ap. J.-C.'
{{ format_date(date_time_object, 'dd MMM Y G') }} => '01 août 2011 ap. J.-C.'

More information about patterns can be found here: http://userguide.icu-project.org/formatparse/datetime
16 changes: 8 additions & 8 deletions Resources/doc/reference/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ retrieved by using the session instance.

.. code-block:: twig

{% country 'FR' %} => France
{% country 'FR', 'en' %} => France (force the locale)

{% language 'fr' %} => français (if the current locale in session is 'fr')
{% language 'FR', 'en' %} => french (force the locale)

{% locale 'fr' %} => français (if the current locale in session is 'fr')
{% locale 'FR', 'en' %} => french (force the locale)
{{ country('FR') }} => France (if the current locale in session is 'fr')
{{ country('FR', 'de') }} => Frankreich (force the locale)
{{ language('fr') }} => français (if the current locale in session is 'fr')
{{ language('fr', 'en') }} => French (force the locale)

{{ locale('fr') }} => français (if the current locale in session is 'fr')
{{ locale('fr', 'en') }} => French (force the locale)

14 changes: 7 additions & 7 deletions Resources/doc/reference/number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ retrieved by using the session instance.

.. code-block:: twig

{% currency 10.49, 'EUR' %} => 10,49 €
{% decimal 10.15459 %} => 10,155
{% scientific 1000 %} => 1E3
{% duration 1000000 %} => 1 000 000
{% spellout 42 %} => quarante-deux
{% percent 1.999 %} => 200 %
{% ordinal 1 %} => 1ᵉʳ
{{ number_format_currency(10.49, 'EUR') }} => 10,49 €
{{ number_format_decimal(10.15459) }} => 10,155
{{ number_format_scientific(1000) }} => 1E3
{{ number_format_duration(1000000) }} => 1 000 000
{{ number_format_spellout(42) }} => quarante-deux
{{ number_format_percent(1.999 )}} => 200 %
{{ number_format_ordinal(1) }} => 1ᵉʳ