• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

TimeAgo Localized

TimeAgo texts can be localized with the locale attribute. TimeAgo generates automatically updating fuzzy timestamps (e.g. "4 minutes ago"). Based on jquery-timeago by Ryan McGeary.

TimeAgo Tag Documentation

TimeAgo displays relative time for a given date/time value.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
locale Object false Locale used to localize the relative time. Can be a string or java.util.Locale instance.
style String false Inline style of the component.
styleClass String false Style class of the component.
titlePattern String false Pattern used for the title text.
value Object true Date/time value to display.
Tag Documentation Widget Source Basic Localized
Localized

Register the strings of a locale in PrimeFacesExt.locales.TimeAgo and select it with locale. The locale is applied to the whole jquery-timeago plugin, which is why this example is on its own page.

You've opened this page .

PrimeFaces Extensions was first released .

Usage


<div class="card">
    <h5>Localized</h5>
    <p>Register the strings of a locale in <code>PrimeFacesExt.locales.TimeAgo</code> and select it with <code>locale</code>. The locale is applied to the whole jquery-timeago plugin, which is why this example is on its own page.</p>
    <script>
      PrimeFacesExt.locales.TimeAgo['nl'] = {
        prefixAgo: null,
        prefixFromNow: "over",
        suffixAgo: "geleden",
        suffixFromNow: null,
        seconds: "minder dan een minuut",
        minute: "ongeveer een minuut",
        minutes: "%d minuten",
        hour: "ongeveer een uur",
        hours: "ongeveer %d uur",
        day: "een dag",
        days: "%d dagen",
        month: "ongeveer een maand",
        months: "%d maanden",
        year: "ongeveer een jaar",
        years: "%d jaar",
        wordSeparator: " ",
        numbers: []
      }
    </script>

    <p>
        You've opened this page
        <pe:timeAgo value="#{basicTimeAgoController.created}"
                    locale="nl" style="font-weight:bold"/>.
    </p>
    <p>
        PrimeFaces Extensions was first released
        <pe:timeAgo value="#{basicTimeAgoController.firstRelease}"
                    locale="nl" style="font-weight:bold"/>.
    </p>
</div>