Add date range selector to calendar events

This commit is contained in:
Brian Miyaji
2014-10-23 00:13:40 +11:00
parent 640d896649
commit 12064bd8c3
13 changed files with 413 additions and 44 deletions

View File

@@ -14,6 +14,8 @@ $primary_result = get_option( 'sportspress_primary_result', null );
$defaults = array(
'status' => 'default',
'date' => 'default',
'date_to' => 'default',
'date_from' => 'default',
'number' => -1,
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false,
@@ -31,6 +33,10 @@ if ( $status != 'default' )
$calendar->status = $status;
if ( $date != 'default' )
$calendar->date = $date;
if ( $date_from != 'default' )
$calendar->from = $date_from;
if ( $date_to != 'default' )
$calendar->to = $date_to;
if ( $order != 'default' )
$calendar->order = $order;
$data = $calendar->data();

View File

@@ -14,6 +14,9 @@ global $wpdb, $m, $monthnum, $year, $wp_locale;
$defaults = array(
'id' => null,
'status' => 'default',
'date' => 'default',
'date_to' => 'default',
'date_from' => 'default',
'initial' => true,
'caption_tag' => 'h4',
'show_all_events_link' => false,
@@ -25,6 +28,12 @@ if ( isset( $id ) ):
$calendar = new SP_Calendar( $id );
if ( $status != 'default' )
$calendar->status = $status;
if ( $date != 'default' )
$calendar->date = $date;
if ( $date_from != 'default' )
$calendar->from = $date_from;
if ( $date_to != 'default' )
$calendar->to = $date_to;
$events = $calendar->data();
$event_ids = array();
foreach ( $events as $event ):

View File

@@ -15,6 +15,8 @@ $defaults = array(
'id' => null,
'status' => 'default',
'date' => 'default',
'date_to' => 'default',
'date_from' => 'default',
'number' => -1,
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
'link_venues' => get_option( 'sportspress_link_venues', 'yes' ) == 'yes' ? true : false,
@@ -35,6 +37,10 @@ if ( $status != 'default' )
$calendar->status = $status;
if ( $date != 'default' )
$calendar->date = $date;
if ( $date_from != 'default' )
$calendar->from = $date_from;
if ( $date_to != 'default' )
$calendar->to = $date_to;
if ( $order != 'default' )
$calendar->order = $order;
$data = $calendar->data();