We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15510
    • 70 Posts
    I had a similar problem recently.

    My date source was a TV and was called out in the Ditto parameter list. I got Dec. 31, 1969 regardless of what the TV contained.

    The solution that worked for me was to set the Input Type of the TV to Date, set the widget to Unixtime, and use the format string "&dateFormat=`%B %d, %Y`" in the Ditto call. It worked then.
      • 4749
      • 623 Posts
      kc64,
      Thanks for the reply, but I’m trying to avoid date tv’s there would be WAY too many for me to have to go back in and adjust. The date I’m pulling is through ditto’s blogging capability and the format of the date was never a problem until recently. Something must have changed on the server or in ModX somewhere that caused this. For the life of me I can’t seem to find what it was. One day the dates were working and the next day they weren’t.
        The MODx has you...
        Utah Web Design
        • 28033
        • 925 Posts
        I got this issue when I was duplicating content, I think. Only noticed it because of having a sitemap for Google.
          My Snippets
          -> PopUpChunk v1.0
          • 4749
          • 623 Posts
          Duplicating content how? What was it specifically? Did you resolve it? How?

          Sorry, I’m very frustrated at this point. I’ve tried so many things to remedy the problem and nothing has worked. If you could expound on your problem I would appreciate it. Thanks.
            The MODx has you...
            Utah Web Design
            • 28033
            • 925 Posts
            Quote from: cbaone at Jun 19, 2008, 08:19 PM

            Duplicating content how? What was it specifically? Did you resolve it? How?

            Sorry, I’m very frustrated at this point. I’ve tried so many things to remedy the problem and nothing has worked. If you could expound on your problem I would appreciate it. Thanks.

            It was odd, since it only affected two sections I had duplicated (had four different versions of a game that used part of the same content, as an example for one of them). Besides just messing with the date, it also applied the value "0" to the editor’s ID.

            The easiest way I solved it was via phpMyAdmin (although I could have done it via the Manager).
              My Snippets
              -> PopUpChunk v1.0
              • 7231
              • 4,205 Posts
              By chance did you update to Ditto 2.1+? The dateFilter extender seems to have been rewritten as a class in the new version so if you are using mixed versions it may not work right. Just a reminder that you need to update the files in assets/snippets/ditto AND the snippet in the manager when updating snippets.

              To troubleshoot have you tried removing the dateFilter extender from your Ditto call to see if that could be the problem?
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 4749
                • 623 Posts
                I’ll try taking out the dateFilter and see if that does it. But as far as the versions of Ditto and all the right files... I made that mistake on my first ModX site. So, those are all from the same version. Thanks, I’ll let you know what happens with the date filter.

                EDIT: Removing dateFilter didn’t change a thing! sad
                  The MODx has you...
                  Utah Web Design
                  • 7231
                  • 4,205 Posts
                  Could it be an OS issue?
                  Not all conversion specifiers may be supported by your C library, in which case they will not be supported by PHP’s strftime(). Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. %e, %T, %R and %D (there might be more) and dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems.
                  I think that Ditto uses strftime to format dates and you are using the %e identifier. Just an idea. Try using a different identifier in the date.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don't know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 4749
                    • 623 Posts
                    It’s interesting for sure, but why would it work for a few weeks then stop? I’m on a Linux - CentOS 4 box, how can I tell if my C library doesn’t support PHP’s strftime()?
                      The MODx has you...
                      Utah Web Design
                      • 7231
                      • 4,205 Posts
                      It’s a long shot but try this in a snippet:
                      <?php
                      $time_test = "strftime(): ".strftime("%B %e, %Y")."<br />";
                      $time_test .= "date(): ".date('F j, Y');
                      
                      return $time_test
                      
                      ?>
                        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                        Something is happening here, but you don&#39;t know what it is.
                        Do you, Mr. Jones? - [bob dylan]