diff --git a/bl-kernel/helpers/date.class.php b/bl-kernel/helpers/date.class.php index 1282c151..6b6af9c9 100644 --- a/bl-kernel/helpers/date.class.php +++ b/bl-kernel/helpers/date.class.php @@ -47,6 +47,15 @@ class Date { return self::translate($output); } + public static function offset($date, $format, $offset) + { + $Date = new DateTime($date); + $Date->modify($offset); + $output = $Date->format($format); + + return self::translate($output); + } + // Format a local time/date according to locale settings. public static function format($date, $currentFormat, $outputFormat) { diff --git a/install.php b/install.php index aeeee7db..ec10ab91 100644 --- a/install.php +++ b/install.php @@ -319,11 +319,13 @@ function install($adminPassword, $timezone) $data = array(); $slugs = array(); + $nextDate = $currentDate; foreach ($pagesToInstall as $page) { $slug = $page; $title = Text::replace('slug','title', $slug); $content = Text::replace('slug','content', $slug); + $nextDate = Date::offset($nextDate, DB_DATE_FORMAT, '-1 minute'); $data[$L->get($slug)]= array( 'title'=>$L->get($title), @@ -331,7 +333,7 @@ function install($adminPassword, $timezone) 'username'=>'admin', 'tags'=>array(), 'type'=>(($slug=='example-page-4-slug')?'static':'published'), - 'date'=>$currentDate, + 'date'=>$nextDate, 'dateModified'=>'', 'allowComments'=>true, 'position'=>1,