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:
parent
548b73db42
commit
091f5ff49f
3 changed files with 50 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue