cleaned up date formatting for display

This commit is contained in:
Ro 2021-04-10 13:44:43 -07:00
parent 72c9b3f9e6
commit 395850adb8
4 changed files with 9 additions and 6 deletions

View file

@ -28,6 +28,7 @@ class DashControl
"stats" => $data["stats"],
"pages" => $data["pages"],
"paginate" => $data["paginate"],
"status" => Session::active(),
];
break;
case "page":
@ -41,11 +42,13 @@ class DashControl
"title" => "Fipamo | Edit Page",
"page" => (new Book("../content/pages"))->findPageById($uuid),
"mode" => $mode,
"status" => Session::active(),
];
} else {
$pageOptions = [
"title" => "Fipamo | Create Page",
"mode" => $mode,
"status" => Session::active(),
];
}
} else {

View file

@ -118,8 +118,6 @@ class Book
$doc = $parser->parse(file_get_contents($file), false);
$meta = $doc->getYAML();
//$date = getdate($meta["created"]);
$newDate = date("Y M D d", $meta["created"]);
$page = [
"id" => $meta["id"],
"uuid" => $meta["uuid"],
@ -129,8 +127,8 @@ class Book
"layout" => $meta["layout"],
"tags" => $meta["tags"],
"author" => $meta["author"],
"prettyDate" => $newDate,
"created" => $meta["created"],
"created" => date("Y M D d", $meta["created"]),
"updated" => date("Y M D d", $meta["updated"]),
"deleted" => $meta["deleted"],
"menu" => $meta["menu"],
"featured" => $meta["featured"],

View file

@ -11,6 +11,7 @@
{% set _title = page['title'] %}
{% set tags = page['tags'] %}
{% set content = page['content'] %}
{% set date = page['created'] %}
{% else %}
{% set id = '' %}
{% set uuid = '' %}
@ -19,6 +20,7 @@
{% set title = '' %}
{% set tags = '' %}
{% set content = '' %}
{% set date = '' %}
{% endif %}
{% block title %}
@ -62,7 +64,7 @@
<label>CREATED</label>
<br/>
<span id="post-date" type="text">
PRETTY DATE
{{ date }}
</span>
</div>
<div id="post-meta" class="column">

View file

@ -40,7 +40,7 @@
<span class="item-options" data-active="{{ featured }}">
Featured</span>
</div>
<span>{{ page.prettyDate }}</span>
<span>{{ page.updated }}</span>
</div>
</a>