diff options
Diffstat (limited to 'app/Module/LifespansChartModule.php')
| -rw-r--r-- | app/Module/LifespansChartModule.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/Module/LifespansChartModule.php b/app/Module/LifespansChartModule.php index 64d7ee3ebc..6028640680 100644 --- a/app/Module/LifespansChartModule.php +++ b/app/Module/LifespansChartModule.php @@ -285,6 +285,11 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac return $carry; }, 0); + // No dates? Show the current year. + if ($jd === 0) { + return (int) date('Y'); + } + $year = $this->jdToYear($jd); // Don't show future dates @@ -308,6 +313,11 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac return $carry; }, PHP_INT_MAX); + // No dates? Show the current year. + if ($jd === PHP_INT_MAX) { + return (int) date('Y'); + } + return $this->jdToYear($jd); } |
