Docs    Facebook    Customizations

Only show events from the next 30 days

Add this JavaScript to your site to only show events from the next 30 days. This can be done manually using a custom JavaScript plugin. For further information see our documentation here.

  var $event = $(this),
      event_date = $event.find('.cff-date > .cff-start-date k').text().trim().replace(',', ''),
      event_date_unix = parseInt((new Date(event_date).getTime() / 1000).toFixed(0)),
      var now = new Date();
  now.setDate(now.getDate() + 30);
  var oneMonthFromNow = (now.getTime() / 1000).toFixed(0);
  if( event_date_unix > oneMonthFromNow ) $event.hide();
}, 100);

Couldn’t find your answer in the docs?

Contact Support

Was this article helpful?