WNAS

Web developer

Datetime in habari

Right now I am reading the most excellent book by the esteemed Bruce Lawson and his partner in crime Remy Sharp. I must say, to start with, that is a great read, which has me whipping out my laptop. Even on a sunday morning, before my 2nd breakfast, which is really uncommon. I even started to hack away at this site, just for the heck of it...

And that is the small thing that I wanted to share with you. I don't know why but I haven't gotten around to properly adding the time attribute to this site, even though I got it in #html5 for quite some time now. Somehow it didn't happen, but anyway, here is the code to add it in habari.

<time 
  datetime="<?php echo $post->pubdate->text_format('{Y}-{m}-{d}'); ?>" 
  pubtime>
    <?php echo $post->pubdate->
      text_format('<span>{M}</span> 
                   <span>{d}</span>, 
                   <span>{Y}</span>'); 
    ?>
</time>

It's just a small bit, but I hope it is of help to someone who uses habari...

It's visible content is in dutch / european order, but I'm sure you can change that to suit yours...

Mathieu - Consultant SEO

Hi,
Thanks for this share!
I just started out an Habari blog for one of my clients and I must say that kind of snippets are really useful as I'm just discovering the script.

It looks really simple like but it's really useful and it helps new users to get along with the blogging script more easily.
Cheers
M.

2011-09-01 07:12