Anyone know how to display date and time on older posts?

whu606whu606 MVP
edited January 2013 in Vanilla 2.0 - 2.8

Posts for the current day display the time posted, but for previous days just the date.

Is there a way to include the date and time of older posts?

Thanks

Tagged:

Comments

  • KasperKasper Vanilla Staff

    I personally use Moment.js for stuff like this.

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • Thanks, @kasperisager.

    I'll try to work out how to apply that at some point.

  • peregrineperegrine MVP
    edited January 2013

    @whu606

    the easiest way is to change what you want via definitions in locale.php

    add the following defs in /conf/locale.php

    e.g.

    // this will put time on posts in previous days
    $Definition['Date.DefaultDayFormat'] = '%B %e %l:%M%p';
    
    // this will put time and day on posts in previous years
    $Definition['Date.DefaultYearFormat'] = '%B %e %l:%M%p';
    
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine

    Perfect!

    You absolute star.

    Thanks very much.

  • peregrineperegrine MVP
    edited January 2013

    no problem. you're a star too - you've got patience and you've got well thought out replies of staggering genius.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited January 2013

    Also, you do realize when you hover over the date in vanilla 2.1.x that the full date appears at least on some themes.

    edit: e.g. this forum

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I hadn't realised that.

    I'm still on 2.0.18 for the live forum.

Sign In or Register to comment.