Browse Source

gère les dates de fin

master
vince vince 2 years ago
parent
commit
919ece382c
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      index.php

+ 7
- 1
index.php View File

@ -101,6 +101,7 @@ if ($hasSupplier) {
'description' => '',
'choices' => [],
'start' => 'now 00:00:00',
'end' => '+1 year 23:59:59',
'frequency' => '1 day',
'password' => '',
'excludes' => [],
@ -212,7 +213,6 @@ try {
if (!$isConfig and !$supplierIsNew and $hasSupplier) {
$start = new \DateTime($config[$supplier]['start']);
if (!$hasEvent) {
$next = findNext($start, $config[$supplier]['frequency'], $config[$supplier]['excludes'], true);
$nextEvent = $next->format('Y-m-d');
header('Location: ' . generateUrl($supplier, $nextEvent));
@ -223,10 +223,16 @@ if (!$isConfig and !$supplierIsNew and $hasSupplier) {
$previousEvent = $previous->format('Y-m-d');
if (false and !array_key_exists($previousEvent, $data[$supplier]))
unset($previousEvent);
$first = new \DateTime($config[$supplier]['start']);
if (true and ($previous->getTimestamp() < $first->getTimestamp()))
unset($previousEvent);
$next = findNext($current, $config[$supplier]['frequency'], $config[$supplier]['excludes'], false);
$nextEvent = $next->format('Y-m-d');
if (false and !array_key_exists($nextEvent, $data[$supplier]))
unset($nextEvent);
$last = new \DateTime($config[$supplier]['end']);
if (true and ($next->getTimestamp() > $last->getTimestamp()))
unset($nextEvent);
}
switch ($action) {


Loading…
Cancel
Save