Support

Account

Home Forums ACF PRO Get date or time from the Date & Time Picker field Reply To: Get date or time from the Date & Time Picker field

  • I managed to solve my problem using the answer here:

    https://support.advancedcustomfields.com/forums/topic/query-date-picker-by-date-then-time/

    			$args = array(
    			  'post_type'      => 'schedule',
    			  'posts_per_page' => '-1',
    			  'meta_query'     => array(
    			      'relation'   => 'AND',
    			        'date_clause' => array(
    			            'key'     => 'schedule_time_slot_%_schedule_show_date',
    			            'compare' => '=',
    			            'value'   => $tue,
    			        ),
    			        'time_clause' => array(
    			            'key'     => 'schedule_time_slot_%_schedule_show_start_time',
    			            'compare' => 'EXISTS',
    			        ),
    			    ),
    			    'orderby' => array(
    			        'date_clause' => 'ASC',
    			        'time_clause' => 'ASC',
    			    )
    			);