Replace Date with a cool new calendar type layout in blogger
38 COMMENTSLauren asked me to show how to add a calendar to dates in blogger and i liked the idea and so i am posting about it. I also want to say that my readers can also contact me via the contact form or twitter (@virtuosoblogger) or even discuss on the facebook page.
The default text for date in blogger might look a little too simple to some, so for those blogger users who want to spice their layout by adding a calendar to their post dates, this post will help you achieve that.
Follow these steps to replace the default with the date in calendar layout:
1. Go to Settings->Formatting and change the Date Header Format with the format DD-MM-YY
2. Go to layout, then click on Edit Html
3. Download the Full Template (So that you don’t lose any date).
4. Search for the following code:
[xml]
<data:post.dateHeader/>
[/xml]
5. Replace the code above with the following code:
[xml]
<div id="date"><script type="text/javascript">// <![CDATA[
replace_date('<data:post.dateHeader />');
// ]]></script></div>
[/xml]
6. Search for the following code:
[xml]
</head>
[/xml]
7. Paste The following code above it:
CSS 3.0
This the CSS code, this governs the look of the calendar. If you know a little bit programming you can make modifications to this code and add your own image.
8. Search for the following code:
[xml]
<body>
[/xml]
9. Just below the code paste the following code:
[java]
<!-date image background–>
<script>
function replace_date(d)
{
var da = d.split(' ');
month = "<div class=’month’>"+da[1].slice(0,3)+"</div>";
day = "<div class=’day’>"+da[0]+"</div>";
year = "<div class=’year’>"+da[2]+"</div>";
document.write(month+day+year);
}
</script>
<!-date image background–>
[/java]
This javascript diaplays the date. You can change the order of display in document.write function.
10. Save the template.
And now your date in calendar style is up and running.
Facing problems? Tell me!!
| This entry was posted by Gautam on August 26, 2009 at 7:42 pm, and is filed under blogger. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |









about 2 years ago
Awesome, thanks so much! Will use this fur sure in a template design!
Reply
about 2 years ago
thank you so much Gautam….
Reply
about 2 years ago
oo. you mean blogger.com or blogspot..
NIce tips and I'll try at my blogspot blog
Reply
about 2 years ago
Nice tutorial. I had my done too. Have a look at http://www.miketok.com
Reply
about 2 years ago
Hi Gautam , great little script for the calendar date – I'm trying to figure out how to display the year though – where do I have to change the script line to denote 'block' in order for the year to be displayed ? other than that : thanks a lot for the script
Reply
about 2 years ago
@Mia: Hey the year should appear if u have used the same code as above but there may be problem due to css of your blog. I prefer u try to change the font sizes so that you get the desired reults.
Reply
about 2 years ago
How can i put it in spanish?
Reply
about 2 years ago
@brian: I think you should use spanish as your blog language and then you might see the date in spanish
Reply
about 2 years ago
Hi Gautam , thank you for your response , I had changed the font size & everything – but it simply just refused to appear – maybe Time is really standing still for me
as you can see I am using Cheth's Template ( and that boy has so much code in there , that I fear touching or altering anything in case it just EXPLODES !
LOL – when I get up the nerve , I will attempt this again . Thank you for your response . Happy blogging G. 
Reply
about 2 years ago
@Mia: Ya it becomes difficult to alter if you have little info and your template is fully loaded but you can still try by first downloading the template for backup purposes and edit the code
Reply
about 2 years ago
Guatam – That's great, I had wondered how you setup the calendar to post as you do.
I will have to try that out on my site.
Reply
about 2 years ago
Thanks for the tutorial!
Somehow, I can't find the first set of codes, which is:
<data:post.dateHeader/>
And then when I tried posting the 2nd set:
<div id='date'>
<script> replace_date('<data:post.dateHeader/>');
</script>
</div>
It said they had an error interpreting blog template.
Help?
Thank you.
Reply
about 2 years ago
If you can't find the code, try to place it above <post.body> or below <post.header>. you have to try and after some trials it will be functioning properly
Recent blog:=- Win 100$ by leaving comments at TechZoomIn
Reply
about 2 years ago
i couldn't do it as well
like carmen chan, there wasn't any
<data:post.dateHeader/>
and when i tried what you suggested it still didn't work *sigh* :'(
Recent blog:=- Shut up and Drive
Reply
about 2 years ago
Manju if it desn't work that means either yur template doesn't have the code or either you have to paste the code just below <data:post.title>. You need to try and after a few, you would be able to add the cutom date.
Reply
about 2 years ago
Your post indirectly helped me clear a bug in my code after I'd worked around the HTML code of my blog's template a bit. That's because I could know that data:post.dateHeader is used for showing date
Thanks anyway
Reply
about 2 years ago
Please tell me how to move the entire calendar about 1 centimeter to the left (how to move left), because i have a photo blog and the first picture is pushed to the right. Please help me with this one !
Reply
about 2 years ago
Thanks so much for this post. I had a devil of a time customizing my custom template but it finally worked! Looks just great!
Reply
about 2 years ago
How would you make the date header to appear in multiple posts on the same day with changing the date from header to timestamp.
Reply
about 2 years ago
You will have to split it according and also difent css tags for it seperately, though i would recommend you use this hack.
Reply
about 2 years ago
I've done as you said but it doesn't show anything
Reply
about 2 years ago
I’m good until step 9, then I get the following error message:
We were unable to save your template
Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.
Reply
about 1 year ago
We were unable to save your template
Same response:
Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.
How do i solve this?
Reply
about 1 year ago
Hello Gautam,
I cannot find the “” code in my HTML script. I suppose it has already been replaved by another code in my template.
Could you help me to find what to do in order to get this calendar?
Thank for your help & time
Regards
Xavier
.-= Xavier Wallach´s last blog ..Photographying sports: soccer =-.
Reply
about 1 year ago
I read all of the previous post, and I cannot finf neither

nor
nor
in my script
.-= Xavier Wallach´s last blog ..Photographying sports: soccer =-.
Reply
about 1 year ago
Greats content. awesome customize date. but i got error on step no 4. I try to recheck again. thank..
.-= cuaryos´s last blog ..Best Ways to Save Automotive Fuel =-.
Reply
about 1 year ago
I tried several times to get this one to work but never was able to. I’m bummed! I love the calander look!
Reply
about 1 year ago
Anyone know why it doesn’t work???
Reply
about 1 year ago
Thanks. very awesome…
Ben´s last [type] ..Mount Lokon at Night
Reply
about 1 year ago
Hey Mate,
I was trying what u said but got stuck at the body part. Which body (line) are u referring to? I searched and the result displayed total of 36 lines that contain body word. A little help please?
Reply
February 7, 2011 - 12:25 am
Same as Affan. I can’t find the body part !
Reply
about 1 year ago
Hi, I try as you suggested but i get this message error:
We were unable to preview your template
Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute “{1}” associated with an element type “id”.
Help. Thank you.
Reply
about 1 year ago
Not working for me on:
http://www.blogdecamisetas.com
Reply
about 8 months ago
I have tried this on my blog, not working. I dont know why. I am using a customized Code Red blog of Brain Gardner. See http://www.tooth-n-nail.blogspot.com
Please advise
Reply
about 3 months ago
i didn’t found the first code and when i click on the Expand widget i found 3 ??
Reply
about 1 month ago
Thanks very awesome
Reply
about 1 month ago
where is the codes in step 7?
Reply