mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 15:23:12 +08:00
Improved DateRange to check if both wrapped dates are empty
This commit is contained in:
@@ -29,7 +29,7 @@ class VisitRepository extends EntityRepository implements VisitRepositoryInterfa
|
||||
$shortUrl = $shortUrl instanceof ShortUrl
|
||||
? $shortUrl
|
||||
: $this->getEntityManager()->find(ShortUrl::class, $shortUrl);
|
||||
if (! isset($dateRange)) {
|
||||
if (! isset($dateRange) || $dateRange->isEmpty()) {
|
||||
$startDate = $shortUrl->getDateCreated();
|
||||
$endDate = clone $startDate;
|
||||
$endDate->add(new \DateInterval('P2D'));
|
||||
|
||||
Reference in New Issue
Block a user