CC-4873: Airtime takes 7 seconds to load 32K (very small) from db

-we know what month will be the initial view for the user.
-Provide this data ahead of time.
This commit is contained in:
Martin Konecny 2013-01-24 12:13:55 -05:00
parent 548b73db42
commit 091f5ff49f
3 changed files with 50 additions and 12 deletions

View file

@ -2176,4 +2176,18 @@ SQL;
}
return $assocArray;
}
public static function getStartEndCurrentMonthView() {
$first_day_of_calendar_month_view = mktime(0, 0, 0, date("n"), 1);
$weekStart = Application_Model_Preference::GetWeekStartDay();
while (date('w', $first_day_of_calendar_month_view) != $weekStart) {
$first_day_of_calendar_month_view -= 60*60*24;
}
$last_day_of_calendar_view = $first_day_of_calendar_month_view + 3600*24*41;
$start = new DateTime("@".$first_day_of_calendar_month_view);
$end = new DateTime("@".$last_day_of_calendar_view);
return array($start, $end);
}
}