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

    I am using Ditto and Reflect to show a list of upcoming events, sorting by a custom date field (myDate).

    Since I’ve upgraded, it seems like it’s not saving the timestamp when choosing a date for an event. Even events that were already entered are just grouping under January 1970. When I print out the myDate TV for debugging, it’s showing all events with the same timestamp, even though they have different dates saved in each document.

    Does anyone know what’s happening to my dates?

    Cheers,
    Jacob
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      How are the dates stored in the database? As a date string, or as a timestamp?
        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
        • 13373
        • 70 Posts
        It’s just a custom Template Variable with Date Input Type, and using the Unixtime Widget.
          • 26277
          • 8 Posts
          Not working for me as well. I’m using the same setup: Input Type - Date, Widget - Unixtime. Any ideas?
            • 27733
            • 99 Posts
            Got this problem as well. Reflect worked properly in 1.0.2, but not in 1.0.4. And the debug console is showing correct unix timestamps in my custom date field. Considering that no changes to Ditto/Reflect code have been made between these versions and that the minor changes in the parser class would not cause this, what could it possibly be ... any clues?
              ------
              Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
              • 26931
              • 2,314 Posts
              Considering that no changes to Ditto/Reflect code have been made between these versions
              might be related (Ditto - Server Offset Time Bug): http://modxcms.com/forums/index.php/topic,50691.0.html
                • 27733
                • 99 Posts
                It doesn’t seem to be an offset issue, although setting the offset properly (in my case to +3) actually kills ditto functionality all together. When the offset is "0" ditto retrieves documents as it should, but reflect doesn’t do its job and just outputs 1969 as the sole category of archives. Other insights?
                  ------
                  Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
                  • 26931
                  • 2,314 Posts
                  It doesn’t seem to be an offset issue
                  no, but maybe Ditto has been updated/altered?
                    • 27733
                    • 99 Posts
                    No, unfortunately it’s not that — I did run a search for differences on the snippet and the classes ... all identical (also checked phx). Any other ideas?
                      ------
                      Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
                      • 13373
                      • 70 Posts
                      Quote from: sottwell at Jun 30, 2010, 06:13 AM

                      How are the dates stored in the database? As a date string, or as a timestamp?
                      Hi Susan,

                      I’ve looked in the actual database to see where the custom template variable data is being stored, and I’ve found the following:

                      It’s not stored in the site_content table, although the document’s data is;

                      The TV info is being stored in the site_tmplvars table;

                      A value IS being stored in the site_tmplvar_contentvalues table, but the date looks like "06-11-2010 10:00:00", and it’s a text field.

                      I presume that Ditto is doing (or should be doing) a conversion of that date string, as it looks like it was stored the same way in my old 0.9.6 sql backup file as well (and it had no trouble there!).

                      Considering that no changes to Ditto/Reflect code have been made between these versions and that the minor changes in the parser class would not cause this
                      Perhaps it has??

                      I wouldn’t even know where to start looking, if this were the case.

                      Cheers,
                      Jake