We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7495
    • 10 Posts
    How can I change the date look?
    Didn’t find any helpful parameters.

    That’s how I want it to look like:
    <div class="date">
          <div class="day">24</div>
          <div class="month">May</div>
          <div class="year">2007</div>
        </div>
      • 25663 MODX Staff
      • 12,272 Posts
      I don’t think Ditto allows for that fine-grained of control over the date output.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 11975
        • 2,542 Posts
        Hi,

        the best way to achieve this is to take advantage of the PHx support in Ditto.
        there are serveral how to sample in the forum.

        :-)

        P.S= I will try to find one of them and will update my post
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
          • 7495
          • 10 Posts
          heliotrope, what is PHx support and what do you think how I can fix the problem?

          MODx is ideal for web professionals that need an easy-to-customize application framework.
          rthrash
          if it would be easy-to-customize this also needs to work wink
            • 6726
            • 7,075 Posts
            First, are you talking (as I suppose) about building an archive page ?
            If so, are we talking about setting the date format in the Reflect templates ? (don’t forget to check the Reflect doc)

            For instance the year. The default template (use &tplYear parameter to set your chunk) for Reflect is :

            [tt]<a href="[+url+]" title="[+year+]" class="reflect_year_link">[+year+]</a>[/tt]

            Never tried, maybe I am wrong, but if you need to customize the [+year+] placeholder this should work (I think that was what Heliotrope was thinking about) :

            [tt][+year:date=`%Y`+][/tt] (or whatever strftime set up you need)

            (See the wiki about using the dateformat modifier with PHx)

            Same will go for &tplMonth for months

            Just apply this to [tt][+month:date=`%m`+][/tt] (or anything else you need)

            Never tested it, but it think it might work that way

              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 18397
              • 3,250 Posts
              I believe he is referring to the [+date+] placeholder in Ditto. This should do the trick:

              <div class="date">
                    <div class="day">[+createdon:date=`%A`+]</div>
                    <div class="month">[+createdon:date=`%B`+]</div>
                    <div class="year">[+createdon:date=`%Y`+]</div>
                  </div>
                • 19889
                • 616 Posts
                Quote from: Mark at Jun 02, 2007, 02:03 AM

                I believe he is referring to the [+date+] placeholder in Ditto. This should do the trick:

                <div class="date">
                      <div class="day">[+createdon:date=`%A`+]</div>
                      <div class="month">[+createdon:date=`%B`+]</div>
                      <div class="year">[+createdon:date=`%Y`+]</div>
                    </div>


                this still kind of confuses me - what would I need to use in order to get just "Jan", "Feb" instead of "January".

                Thank you in advance for your help
                  • 18397
                  • 3,250 Posts
                  Change the %B to %b per one of the options available on http://us2.php.net/strftime
                    • 19889
                    • 616 Posts
                    Quote from: Mark at Jun 28, 2007, 01:49 PM

                    Change the %B to %b per one of the options available on http://us2.php.net/strftime

                    got it - thanks again