Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Period/Month.php')
-rw-r--r--core/Period/Month.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/Period/Month.php b/core/Period/Month.php
index 1918ec3650..40fda847ca 100644
--- a/core/Period/Month.php
+++ b/core/Period/Month.php
@@ -55,4 +55,18 @@ class Piwik_Period_Month extends Piwik_Period
$currentDay = $currentDay->addDay(1);
}
}
+
+ public function isFinished()
+ {
+ if(!$this->subperiodsProcessed)
+ {
+ $this->generate();
+ }
+ // a month is finished
+ // if current month > month AND current year == year
+ // OR if current year > year
+ $year = $this->date->get("Y");
+ return ( date("m") > $this->date->get("m") && date("Y") == $year)
+ || date("Y") > $year;
+ }
}