Change Views filters, add dynamic date value as range

Using EVA field added to Order entity I needed to use order created date as starting range and ending range for dates.
UI by default doesn't offer this in views, so some preprocessing was done. You could fetch date from argument or as I did directly from
$view->current_entity->created; and add it to filter as you like. Use views_pre_build, add code, Clear Cache and it will work.

function mymodule_views_pre_build(&$view) {

//Override output of Filter

  if($view->name == 'commerce_user_orders' && $view->current_display == 'entity_view_6'){

    //Set Times
    $timeframe = 1.5 * 3600;  
    $order_time = $view->current_entity->created;
    $min_time =  $order_time - $timeframe;
    $max_time =  $order_time + $timeframe;

    //Change Filter handlers
    $view->display_handler->handlers['filter']['created']->value['min'] = format_date($min_time,'custom','Y-m-d H:i:s');
    $view->display_handler->handlers['filter']['created']->value['max'] = format_date($max_time,'custom','Y-m-d H:i:s');
  }
}