aboutsummaryrefslogtreecommitdiff
path: root/app/class/Page.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-02-08 15:18:54 +0100
committervincent-peugnet <v.peugnet@free.fr>2020-02-08 15:18:54 +0100
commitc0a2817accea23837ab85b8ba31aabc7fbb20fc3 (patch)
tree7ccfc4ffd83c9ab21538706b969d444019701981 /app/class/Page.php
parent36f5229b006668c989399d91a0ff849f82b9b8cf (diff)
downloadwcms-c0a2817accea23837ab85b8ba31aabc7fbb20fc3.tar.gz
wcms-c0a2817accea23837ab85b8ba31aabc7fbb20fc3.zip
new feature : duplicate close #14
Diffstat (limited to 'app/class/Page.php')
-rw-r--r--app/class/Page.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/class/Page.php b/app/class/Page.php
index e4692e3..c30352c 100644
--- a/app/class/Page.php
+++ b/app/class/Page.php
@@ -444,10 +444,19 @@ class Page extends Dbitem
}
}
+ /**
+ * DateTimeImmutable : set date
+ * string ISO8601 : set date
+ * true : reset to now
+ *
+ * @param string|DateTimeImmutable|true $datecreation Set or reset date of creation
+ */
public function setdatecreation($datecreation)
{
if ($datecreation instanceof DateTimeImmutable) {
$this->datecreation = $datecreation;
+ } elseif ($datecreation === true) {
+ $this->datecreation = new DateTimeImmutable(null, timezone_open("Europe/Paris"));
} else {
$this->datecreation = DateTimeImmutable::createFromFormat(DateTime::ISO8601, $datecreation, new DateTimeZone('Europe/Paris'));
}