Skip to content

Commit

Permalink
Merge pull request #4 from Garfield-fr/master
Browse files Browse the repository at this point in the history
update documentation
  • Loading branch information
rande committed Aug 2, 2011
2 parents 2a42e21 + ca98ba1 commit 97c6567
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
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ᵉʳ

0 comments on commit 97c6567

Please sign in to comment.