We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30585
    • 833 Posts
    Hi guys,

    I know there must be something I`m missing here. I couldn`t find any post addressing this..

    Somewhere on my getResources TPL I have the following call: [[+publishedon:date=`%e %B %Y`]]
    This is supposed to display the publihedon date in this format 18 April 2011.

    Everything looks good except the year in 1970. When I remove the :date=`%e %B %Y` filter, the correct year is displayed. Is there any reason for thisÉ

    [ed. note: treigh last edited this post 12 years ago.]
      A MODx Fanatic
      • 19369
      • 1,098 Posts
      Hi, wrap your code with the "code" tag.
        • 30585
        • 833 Posts
        Here`s the getResources call:

        [[getResources? &resources=`-[[*LienGrandTitre]]` &parents=`39` &limit=`6` &depth=`10`  &tpl=`ArticlePostTPL-Full` &includeTVs=`1` &showHidden=`1`]]
                  <!--/ Editorial -->


        And my tpl:

                  <div itemscope itemtype="http://schema.org/Article" class="recent_post">
                    <h4 itemprop="name"><a href="[[~[[+id]]]]" title="[[+pagetitle]]"><strong>[[+pagetitle]]</strong></a></h4>
                    <span class="post_meta">
                      <strong>[[If? &subject=`[[+tv.SourceArticle]]` &operator=`EQ` &operand=`Mokengeli` &then=`Mokengeli – [[+publishedon:date=`%Y-%m-%d`]]` &else=`Par [[+tv.AuteurArticle]] – [[+tv.SourceArticle]] – [[+publishedon]]`]]</strong>
                      <meta itemprop="datePublished" content="[[+publishedon]]" />
                      <meta itemprop="dateModified" content="[[+editedon]]" />
                    </span>
                    <div class="thumb"><a href="[[~[[+id]]]]" title="[[+pagetitle]]"><img itemprop="image" src="[[+tv.PhotoArticle]]" alt="[[+pagetitle]]" /></a></div>
                    <div class="post_teaser">              
                      <p itemprop="description">[[+introtext:ellipsis=`310`]]</p>
                    </div>
                    <meta itemprop="author" content="[[If? &subject=`[[+tv.SourceArticle]]` &operator=`EQ` &operand=`Mokengeli` &then=`Mokengeli` &else=`[[+tv.AuteurArticle]]`]]" />
                    <meta itemprop="publisher" content="Mokengeli" />
                    <meta itemprop="copyrightHolder" content="[[+tv.SourceArticle]]" />
                  </div>
                  <!--/ Post -->
                <span class="clear"></span>
                       
          A MODx Fanatic
          • 1778
          • 659 Posts
          Hello
          Did you try with
          [[+publishedon:strtotime:date=`%d/%m/%Y`]]
          


          Cheers
            • 30585
            • 833 Posts
            @anso

            nice, it's the strtotime I was forgetting. Thanks a lot. It's working now
              A MODx Fanatic