On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hello!

    My MIGx elements are constructed in this way:
    [{"MIGX_id": "1", "dateShow": "2012-10-09 12:30:00", "placeShow": "Theatre", "typeShow" "Programs"}, {"MIGX_id": "2 "," dateShow ":" 2012-10-10 12:30:00 "," placeShow ":" Theatre "," typeShow "" Programs "}]

    I can see only one element if I know the exact date. For example the October 9, 2012:
    	&where=`{"dateShow:=":"2012-10-09 12:30:00"}`

    I would like to extend this condition and display all the events of October 2012. How to write the condition &where?
    Is it possible to use something like "regexp" ?

    Thanks [ed. note: manonp last edited this post 9 years, 1 month ago.]
    • with this additions

      to core/components/migx/model/migx/migx.class.php

      you can now have custom filter-snippets
      and you can do it now this way:


      snippet 'filtermonth' :

      $month = $modx->getOption('operand',$scriptProperties,'');
      $date = $modx->getOption('subject',$scriptProperties,'');
      $timestamp = strtotime($date);
      $datemonth = strftime('%m/%Y',$timestamp);
      return $datemonth == $month ? '1' : '';
      [ed. note: Bruno17 last edited this post 9 years, 1 month ago.]

        you can buy me a beer, if you like MIGX


      • Thank you very much Bruno17, it works!

        I think these additions will offer me great possibilities.