We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17723
    • 221 Posts
    Hello I've build a fairly big website. On of the key part was a event calendar - with events as resources.
    Now I'm urgently looking for a solution how to filter out past events from upcoming events.
    Date for events is set in TV date. I've tryed to use &where parameter but don't know how to filter it against current date.
    Is there a clean way to do it ? With ditto It was fairly easy?
    Lucas.
      Lucas from AroundCyprus.net
      • 22303 MODX Staff
      • 10,725 Posts
      If it's a TV, you'll have to use tvFilters, but it does not support ranges or operators other than == or || at the moment.
        • 17723
        • 221 Posts
        hmmm....
        So basicly You say it is not possible huh?
        With operator == I can't filter date bigger or lower then.
        Is there any other way I can do it ? What You would suggest ?
        The website is already builde with Revo and didn't thought that it might be a problem with filtering by TV date.
        Thanks,
        Lucas

          Lucas from AroundCyprus.net
          • 37047 ☆ A M B ☆
          • 309 Posts
          I have a site that lists events with each event being a resource. I set the UNpublish date for a resource to be the date after the event (or midnight on the day of). It's not ideal, but it works as long as your getResources call is only looking for published resources.
            Lucy Iannotti
            Following Sea design & development
            http://www.following-sea.com
            New Bedford, MA
            • 17723
            • 221 Posts
            Yeas,
            but what You then do to list and view unpublished resources?
              Lucas from AroundCyprus.net
              • 37047 ☆ A M B ☆
              • 309 Posts
              This method prevents past events from showing up at all. Do you need to be able to list past events?
                Lucy Iannotti
                Following Sea design & development
                http://www.following-sea.com
                New Bedford, MA
                • 17723
                • 221 Posts
                I need to see the past events also.
                  Lucas from AroundCyprus.net
                  • 23510
                  • 168 Posts
                  Question - when you set an unpublish date for a document and the date passes and the document becomes unpublished, does the unpublish date stay recorded for the resource?

                  I have some records with expiry date I need to filter and sort. It seems I can't do this with tvDates. Using the unpub date is an idea but I need to keep a record of the date after the document is unpublished.

                  John