This sorta fixes #19

This commit is contained in:
Tim Schumacher 2015-03-21 14:20:17 +01:00
parent cc9a48315f
commit 97a71875e9

View file

@ -41,10 +41,13 @@ class GenerateEventsCommand extends ContainerAwareCommand
/** @var EntityManager $entityManager */
$entityManager = $this->getContainer()->get('doctrine')->getManager();
$repo = $entityManager->getRepository('CalciferBundle:RepeatingEvent');
$entities = $repo->findAll();
$entities = $repo->findBy([],['id' => 'asc']);
foreach($entities as $entity) {
/** @var RepeatingEvent $entity */
$next_date = is_null($entity->nextdate) ? new DateTime() : $entity->nextdate;
/** This is a fuggly hack. It would be best to store the named timezone also in the
* database to avoid problems with daylight savings. */
$next_date->setTimezone(new \DateTimeZone('Europe/Berlin'));
$parser = new RelativeDateParser($entity->repeating_pattern,$next_date,'de');
$event = null;
while (($next_date = $parser->getNext()) < $end) {