We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15734
    • 70 Posts
    I know this has been talked about some. I tried looking through the forums but haven't found any answers. I'm creating a site for a gallery. They want to show current exhibitions, an archive of exhibitions and upcoming exhibitions. I've created 2 TVs, startDate and endDate. I also created a small snippet that just returns the current time (UNIX timestamp) I'm trying to use variations of this to get the current exhibitions:
    &tvFilters=`startDate<=[[!time]],endDate>=[[!time]]`

    Doesn't seem to work. I'm using latest versions of everything. Is this possible?
    Any help would be appreciated.
      • 44234
      • 219 Posts
      I had a simular issue displaying books that had been published in the last 2 months:

      Filter:
      &tvFilters=`bk-pubDate>=[[!getDate:date=`%Y-%m-%d`? &offset=`-2 month`]]`


      getDate Snippet:
      <?php
      $offset = $modx->getOption('offset',$scriptProperties,'now');
      $ts = strtotime("$offset");
      return (string) $ts;
      ?>

      I also had to make sure that the 'Date Format' (in the tv's output options) was set to '%s'.
        Find me on Twitter, GitHub or Google+