Prise en compte des dimanches en automatique

This commit is contained in:
Michael RICOIS 2016-10-24 14:37:05 +02:00
parent ae98283511
commit 7bd12f7607

View File

@ -74,10 +74,13 @@ else {
if ($dateBegin === null) {
$dateBegin = new DateTime();
$dateBegin->sub(new DateInterval('P1D'));
// Lundi prendre aussi dimanche
if ($dateBegin->format('w') == 1) {
$dateBegin->sub(new DateInterval('P1D'));
}
}
$dateBegin->setTime(0, 0, 0);
$c = new Zend_Config($application->getOptions());
$db = Zend_Db::factory($c->profil->db->metier);
Zend_Db_Table_Abstract::setDefaultAdapter($db);