Show Only Todays events

Home Forums Calendar Products Events Calendar PRO Show Only Todays events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #967589
    Chris
    Participant

    Hi, I have looked at the other 2 or 3 forum posts on this and cannot figure it out. My query almost works.

    $current_date = date("Y-m-d");
    	//$current_date = date('2015-06-11');
    	$datetime = new DateTime('tomorrow');
    	$args=array(
    		'post_type' =>'tribe_events',
    		'eventDisplay' => 'all',
    		'posts_per_page'=> 10,
    		'start_date' => $current_date,
    		'end_date' => $datetime->format('Y-m-d'),
    		'order' => "ASC"
    	);

    Shouldn;t just using $current_date for both start and end work? When I do that, it shows all events. Any help would be awesome.

    #967590
    Chris
    Participant

    Sorry, my query is this:

    $args=array(
    		'post_type' =>'tribe_events',
    		'eventDisplay' => 'custom',
    		'posts_per_page'=> 10,
    		'start_date' => $current_date,
    		'end_date' => $datetime->format('Y-m-d'),
    		'order' => "ASC"
    	);
    	
    #967704
    Brian
    Member

    Hi,

    Thanks for using our plugins.

    Have you tried what we do for the day view and use these arguments:

    'eventDate' => $current_date,
    'eventDisplay' => 'day'

    You would want to remove these then:

    'eventDisplay' => 'custom',
    'start_date' => $current_date,
    'end_date' => $datetime->format('Y-m-d'),

    Also, the format for date and time in a query needs to be in ‘Y-m-d H:i:s’ So if that above does not work maybe you can go back to your original query and add in time.

    Let me know how that works out.

    Thanks

    #984255
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Show Only Todays events’ is closed to new replies.