We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9572
    • 56 Posts
    I’m trying to figure out how to format the date that the entry was created and can’t seem to figure out how.

    This is my Ditto call;
    [[Ditto? &tpl=`blogentry` &dateFormat=`%D` &startID=`7` &sortBy=`createdon` &summarize=`3` ]]


    In my template I use the placeholder [+createdon+]

    I want to display the date as 12/29/06 for instance (which I assume is %D from the PHP time site)

    What is wrong with my call?

    Here is the site; http://www.fegul.com/modx/index.php?id=7
      • 11975
      • 2,542 Posts
      Hi,

      I guess when dateFormat is enabled, you have to use the [+date+] placeholder to display the value.

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 9572
        • 56 Posts
        wow, so simple! I was beating my brains out for hours over that.

        Why is there a createdon placeholder then if you can’t format its value?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          So you can put it wherever you want it.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 9572
            • 56 Posts
            Quote from: sottwell at Dec 31, 2006, 09:26 AM

            So you can put it wherever you want it.
            I guess I’m a little confused then.

            Why wasn’t I able to use the createdon placeholder and format it with the parameter in the call? I’m not sure how useful a placeholder that only displays the date in seconds since Jan. 1970 would be.

            Now I’m confused smiley
              • 18397
              • 3,250 Posts
              The createdon placeholder is there for those that want to pass that value to a snippet for further processing. Also, the next release of Ditto will not have a date placeholder in favor of having phx style formatting.