Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_show_entry_dates

This hook allows you to customize the dates where an entry will be displayed when using a calendar View. Use this hook to add recurring events to a calendar View.

Usage

add_filter('frm_show_entry_dates', 'customize_recurring_events', 10, 2);
function customize_recurring_events($dates, $entry)

Parameters

  • $dates (array)
  • $entry ($object)

Examples

Create a weekly recurring event

Use this code to make a submitted event appear on your Calendar once every week. In order for this example to work, you must have a radio button or checkbox field in your form where a user can select "Yes" if the event should recur weekly.

add_filter('frm_show_entry_dates', 'weekly_recurring_event', 10, 2);
function weekly_recurring_event($dates, $entry){
    if ( $entry->form_id == 5 ){ //change 5 to the ID of your form
	if ( isset($entry->metas[125]) && $entry->metas[125] == 'Yes' ) {//Change 125 to the ID of your "Recurs weekly" field
	    $start_date = reset($dates);
	    $end_date = strtotime('2020-12-31');//End date of the recurring event
            for ($i = strtotime($start_date); $i <= $end_date; $i = strtotime('+1 week', $i)) {
		$dates[] = date('Y-m-d', $i);
            }
	}
   }
   return $dates;
}
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms