diff --git a/lib/command/export-events.php b/lib/command/export-events.php index 9a348ee..b847705 100644 --- a/lib/command/export-events.php +++ b/lib/command/export-events.php @@ -61,6 +61,10 @@ class Ai1ec_Command_Export_Events extends Ai1ec_Command { 'xml', false ); + $params['window'] = (bool)Ai1ec_Request_Parser::get_param( + 'window', + false + ); $this->_params = $params; return true; } @@ -90,6 +94,7 @@ class Ai1ec_Command_Export_Events extends Ai1ec_Command { $ai1ec_cat_ids = $this->_params['cat_ids']; $ai1ec_tag_ids = $this->_params['tag_ids']; $ai1ec_post_ids = $this->_params['post_ids']; + $window = $this->_params['window']; if ( ! empty( $this->_params['lang'] ) ) { $loc_helper = $this->_registry->get( 'p28n.wpml' ); $loc_helper->set_language( $this->_params['lang'] ); @@ -115,9 +120,16 @@ class Ai1ec_Command_Export_Events extends Ai1ec_Command { $ai1ec_post_ids ); } + $my_start = '-3 years'; + $my_end = '+3 years'; + if ( $window ) { + $my_start = '-30 days'; + $my_end = '+30 days'; + } + $filter = apply_filters( 'ai1ec_export_filter', $filter ); - $start = $this->_registry->get( 'date.time', '-3 years' ); - $end = $this->_registry->get( 'date.time', '+3 years' ); + $start = $this->_registry->get( 'date.time', $my_start ); + $end = $this->_registry->get( 'date.time', $my_end ); $search = $this->_registry->get( 'model.search' ); $params = array( 'no_html' => $this->_params['no_html'], @@ -156,4 +168,4 @@ class Ai1ec_Command_Export_Events extends Ai1ec_Command { return $output; } -} \ No newline at end of file +}