Tweak your Aspire – Show Post Date Correctly  

Posted by Jaideep Walia in , , , ,

Though I had already written on how to Show post date Correctly HERE it actually involved more code to be added.

I am again writing it for the benefit of others and also to have some continuity in posts.

Let’s start this small tutorial….

  • Go to Layout -> Edit HTML

  • Click Expand Widget Templates.

  • Now find the following Code

    var timestamp = &quot;<data:post.timestamp/>&quot;;
  • The code around it should look like this

    <script type='text/javascript'>
      var timestamp = &quot;<data:post.timestamp/>&quot;;
      if (timestamp != &#39;&#39;) {
          var timesplit = timestamp.split(&quot;,&quot;);
          var date_yyyy = timesplit[2];
          var timesplit = timesplit[1].split(&quot; &quot;);
          var date_dd = timesplit[2];
          var date_mmm = timesplit[1].substring(0, 3);
      }
    </script>
    <script type='text/javascript'>document.write(date_dd);</script>
    <div class='month'><script type='text/javascript'>document.write(date_mmm);</script></div>
    
    

  • Now Change the line from

    var timestamp = &quot;<data:post.timestamp/>&quot;;

  • TO
    var timestamp = &quot;<data:post.dateHeader/>&quot;;

  • And the Final code should look like
    
    <script type='text/javascript'>
      var timestamp = &quot;<data:post.dateHeader/>&quot;;
      if (timestamp != &#39;&#39;) {
          var timesplit = timestamp.split(&quot;,&quot;);
          var date_yyyy = timesplit[2];
          var timesplit = timesplit[1].split(&quot; &quot;);
          var date_dd = timesplit[2];
          var date_mmm = timesplit[1].substring(0, 3);
      }
    </script>
    <script type='text/javascript'>document.write(date_dd);</script>
    <div class='month'><script type='text/javascript'>document.write(date_mmm);</script></div>
    
    
    Now Go to Settings and then Formatting tab and make changes as shown below.

    aspire1

    Of course Choose the Time Zone as per your location :)

    There is a way on Adding year to the date, but I am still working on it.

  • This post was:

    This entry was posted on Tuesday, April 14, 2009 at 8:00 PM and is filed under , , , , . You can follow any responses to this entry through the comments feed .

    23 comments

    Thanks for this. I'm not working with Aspire, but I'm trying to modify my "Notepad" blogger theme (also from InfoCreek) My post date was showing up as "Undefined" and bleeding into the next column. Thanks to your code, I now have the date, but the placement is wrong *sigh* I have number (day) on one line at the right and the month on the next line at the left. Closer, but no cigar.

    April 21, 2009 at 9:30 PM

    @ Deb
    I visited your blog and could see the prolem. You have to make some changes. First Backup your template.
    Then search for the following code and delete it.

    <div class='month'><script type='text/javascript'>document.write(date_m);</script></div>

    Just above this code you will find another line of code as shown below.
    <script type='text/javascript'>document.write(date_dd);</script>

    You have to change this code so that it looks like..

    <script type='text/javascript'>document.write(date_dd + date_m);</script>


    Do tell me if it helped. I could have posted it to your blog but such a cute blog does not deserve hard code :) comments.
    And this comment here might be helpful to some one else.

    April 22, 2009 at 8:44 AM

    Thank you! That worked wonderfully.

    When I visit the site (http://www.infocreek.com/webdesign/notepad.html) I see that the date and month were intended to be on separate lines, but they were supposed to be at the far right in a fancy font. Since that wasn't working, your fix is much better!

    Sorry my email didn't show up. Your comment box didn't allow me to input it and I'd rather not make it public.

    Thanks again for your help. It's a GREAT theme!

    April 22, 2009 at 9:55 PM

    Thank you, that's very helpful.

    May 3, 2009 at 9:50 AM

    I'm still having problems finding that first code that you said to look for, I don't think I have it in my code, is that possible? Is there another one I should be looking for? Thanks for your help!

    May 17, 2009 at 9:14 AM

    hello
    how to have a calendar like you

    May 31, 2009 at 12:01 AM

    You're the man .. Thanks a million

    July 15, 2009 at 7:03 PM

    I know this is for encouragement, but I did exactly as you suggested for the date to show, I managed to find the right place, fixed it, saved the template, checked the right date, viewed the Aspire blog, saw the date - perfect! I went back to my post, read it again, changed nothing and went back to view it. The correct date had gone and in its place was the number 200! Could you explain this? I checked the HTML and the change to 'dateHeader' was intact. I am totally flumoxed! How did that happen? Appreciate all the help I can get. Oh! And the edit pencil is in the wrong place and the pencil of the top post does not react to any kind of prodding. Lovely template, with a lot of problems. Thanks for any advice you're able to send my way. You do a great service for a whole lot of people - thanks! G

    August 31, 2009 at 3:32 AM

    Awesome.. saved my day

    December 12, 2009 at 12:56 PM

    Hi!

    I try ...But I'm still having problems finding that first code that you said to look for, and no date in my blog... :(
    You can see: http://tirrelico.blogspot.com/
    Thanks

    January 23, 2010 at 3:27 AM

    Hi!

    I try...but the date...:(
    You can see: tirrelico.blogspot.com

    tks

    January 23, 2010 at 4:48 AM

    Thank you very, very, much! Big hello to you!

    April 8, 2010 at 4:33 AM

    Just like Lizz & others above I can't find the code by you indicated in my html file. Where do I go from here?

    April 29, 2010 at 12:05 PM

    I too am having trouble with the date. For me, the box is blank. I searched for the "var timestamp = "";" line you referenced and it is not in my code. Can you give me instructions on how to get the date to show on my blog posts.

    My blog is at http://www.faithandthemagickingdom.net.

    Thank you.

    July 22, 2010 at 4:00 AM

    @Randy.... Have you tried "Click Expand Widget Templates."...

    And search for var timestamp =
    it should be there.

    August 24, 2010 at 9:03 AM

    in my theme template html

    "var timestamp =" is there

    the date format is right

    but it's not work ,i can't find what wrong with it

    i user toggler theme for my blogger , can u help me ??

    3Q

    March 5, 2011 at 4:55 PM

    Same problem then H.G

    The bring no value.

    June 28, 2011 at 7:10 AM

    i cant find this code on my html...can u pls help?
    http://changeandrevolution.blogspot.com/

    August 20, 2011 at 5:48 PM

    thank you thank you thank you so much Muah!

    June 3, 2016 at 10:40 AM

    Post a Comment

    Post a Comment

    Comment for encouragement