• Resolved amineriad

    (@amineriad)


    Hello,

    I set the expiry date on the event start. However, the event expires 24 hours before the first day of the event. Can you help?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rita Kikani

    (@kikanirita)

    Hi @amineriad ,

    Please let me know the plugin version and also let me know that then when you want to expire your event? at the end of the day(12 PM) or at the end-time of the event?

    Thank you.

    Thread Starter amineriad

    (@amineriad)

    Hello, the version I am using is 3.1.38. I would like the event to expire at the end of the Start Date (befote the second day of the event). Ir used to function well but now there seems to be a problem. As I said before, even if I use the start date as the expirt date, the event expires before the event starts.

    Plugin Author Rita Kikani

    (@kikanirita)

    Hi @amineriad ,

    Please try below code in your theme functions.php file, this may help you.

    	// This will help to set your expire date same as event start date
    add_filter('wpem_expire_date_time', 'wpem_change_expire_date_time', 10, 2);
    function wpem_change_expire_date_time($expire_date, $event){
    	//this will return event expire date and time
    	$expire_date = date('Y-m-d', strtotime($event->_event_start_date));
    	$expire_date = date('Y-m-d', strtotime($expire_date). ' 23:59:30');
    	return $expire_date;
    }
    
    // This will help you to expire event as per your country timezone
    add_filter('wpem_get_current_expire_time', 'get_current_date_time');
    function get_current_date_time($date){
    	//this will return your current date and time
    	// pass your country timezone string here
    	date_default_timezone_set('Asia/Kolkata');
    	return date("Y-m-d H:i:s");
    }

    You need to replace 'Asia/Kolkata' with your country time-zone.

    If you have still any issue or query then please open support ticket, our team will help you.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Expiry Date Problem’ is closed to new replies.