/**
  * Return the date of the first day in the month view grid.
  *
  * This is not necessarily the last day of the specified month, rather it is the date of
  * the final grid cell which could be anything upto 6 days into the next month.
  *
  * @param string  $month
  * @param integer $start_of_week
  *
  * @return bool|string (Y-m-d)
  */
 public static function calculate_final_cell_date($month, $start_of_week = null)
 {
     if (null === $start_of_week) {
         $start_of_week = (int) get_option('start_of_week', 0);
     }
     $last_day = Tribe__Date_Utils::last_day_in_month($month);
     $end_of_week = Tribe__Date_Utils::week_ends_on($start_of_week);
     if ($end_of_week < $last_day) {
         $end_of_week += 7;
     }
     $diff = $end_of_week - $last_day;
     if ($diff >= 0) {
         $diff = "+{$diff}";
     }
     try {
         $date = new DateTime($month);
         $date = new DateTime($date->format('Y-m-t'));
         $date->modify("{$diff} days");
         return $date->format(Tribe__Date_Utils::DBDATEFORMAT);
     } catch (Exception $e) {
         return false;
     }
 }