Skip to content

Commit

Permalink
use the right year arg
Browse files Browse the repository at this point in the history
%G can give you the wrong year unless the 1st is a monday and therefore
%a new week
  • Loading branch information
AD7six committed Jan 1, 2012
1 parent 4bf1e19 commit 31e1218
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion View/Layouts/post.ctp
Expand Up @@ -6,7 +6,7 @@
<header> <header>
<h1 class="title"><?php echo $title_for_layout ?></h1> <h1 class="title"><?php echo $title_for_layout ?></h1>
<?php if (!empty($postDate)) { ?> <?php if (!empty($postDate)) { ?>
<h3 class="date"><?php echo strftime('%e %B, %G', $postDate) ?></h3> <h3 class="date"><?php echo strftime('%e %B, %Y', $postDate) ?></h3>
<?php } ?> <?php } ?>
<p class="meta"> <p class="meta">
</p> </p>
Expand Down
2 changes: 1 addition & 1 deletion View/Posts/archives.ctp
Expand Up @@ -6,6 +6,6 @@ title: All posts
<h1>All articles</h1> <h1>All articles</h1>
<ul class="posts"> <ul class="posts">
<?php foreach($posts as $post): ?> <?php foreach($posts as $post): ?>
<li><span><?php echo strftime('%d %b, %G', $post['date']) ?></span> » <a href="<?php echo $post['url']?>"><?php echo $post['title'] ?></a></li> <li><span><?php echo strftime('%d %b, %Y', $post['date']) ?></span> » <a href="<?php echo $post['url']?>"><?php echo $post['title'] ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
4 changes: 2 additions & 2 deletions View/Posts/home.ctp
Expand Up @@ -7,13 +7,13 @@ description: Latest posts from Somebody
<h2>Title</h2> <h2>Title</h2>
<p>Tagline.</p> <p>Tagline.</p>
<?php $latest = $this->Post->data($latest); ?><h2>Latest: <a href="<?php echo $latest['url'] ?>"><?php echo $latest['title'] ?></a></h2> <?php $latest = $this->Post->data($latest); ?><h2>Latest: <a href="<?php echo $latest['url'] ?>"><?php echo $latest['title'] ?></a></h2>
<h3 class="date"><?php echo strftime('%e %b, %G', $latest['date']) ?></h3> <h3 class="date"><?php echo strftime('%e %b, %Y', $latest['date']) ?></h3>
<?php echo $latest['intro'] ?> <?php echo $latest['intro'] ?>


<h2>Recent Writing</h2> <h2>Recent Writing</h2>
<ul class="posts"> <ul class="posts">
<?php foreach($posts as $post): ?> <?php foreach($posts as $post): ?>
<li><span><?php echo strftime('%d %b, %G', $post['date']) ?></span> » <a href="<?php echo $post['url']?>"><?php echo $post['title'] ?></a></li> <li><span><?php echo strftime('%d %b, %Y', $post['date']) ?></span> » <a href="<?php echo $post['url']?>"><?php echo $post['title'] ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
<li><a href="/archives.html">All articles</a></li> <li><a href="/archives.html">All articles</a></li>
</ul> </ul>

0 comments on commit 31e1218

Please sign in to comment.