0
Welcome Guest! Login
0 items Join Now

Particle don't use configured Timezone

  • Particle don't use configured Timezone

    Posted 3 years 11 months ago
    • Hi.
      My site is configured to use Mexico City timezone and the articles are stored and displayed correctly, but when i display them in my custom particle (even in Joomla articles particle) the time zone of Joomla is ignored and it uses UTC.

      I've tried to change the twig filter, as mentioned here: twig.symfony.com/doc/3.x/filters/date.html#timezone
      like this
      {{- article.publish_up|date(item.dateFormat, 'America/Mexico_City') -}}
      or
      {{- article.publish_up|date(item.dateFormat, false) -}}
      but maybe I'm implementing this in a wrong way

      this is the code of both Twig and Yaml files:
      {% if item.dateEnabled %}
          <p class="g-news-grid-item-info-details-date">
              {%- if item.dateEnabled == 'published' -%}
                  {{- article.publish_up|date(item.dateFormat) -}}
              {%- elseif item.dateEnabled == 'modified' -%}
                  {{- article.modified|date(item.dateFormat) -}}
              {%- else -%}
                  {{- article.created|date(item.dateFormat) -}}
              {%- endif -%}
      {% endif %}
      
      .dateFormat:
        type: select.date
        label: Date Format
        description: Select preferred date format.
        default: l, F d, Y
        selectize:
            allowEmptyOption: true
        options:
            'l, F d, Y': Date1
            'l, d F': Date2
            'D, d F': Date3
            'F d': Date4
            'd F': Date5
            'd M': Date6
            'D, M d, Y': Date7
            'D, M d, y': Date8
            'l': Date9
            'l j F Y': Date10
            'j F Y': Date11

      Can you help me?

      Thank you
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Particle don't use configured Timezone

    Posted 3 years 11 months ago
    • As this really is a development question and nothing to do with any RT products that you would best ask your question in the Gantry 5 opensource project chat room where like-minded developers will be able to assist you. https://gitter.im/gantry/gantry5

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.038 seconds