Replace Date with a cool new calendar type layout in blogger
27 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:
<data:post.dateHeader/>
5. Replace the code above with the following code:
<div id=’date’>
<script> replace_date('<data:post.dateHeader/>');
</script>
</div>
6. Search for the following code:
</head>
7. Paste The following code above it:
<style>
/* To view the year change the "none" to "block" */
#date {
display: block;
float:left;
margin: 0 5px 0px 0;
padding: 1px 15px 15px 10px;
color: #333;
background: transparent url(http://bloggertipspro.googlepages.com/Calendar.png) no-repeat;
border: 0;
text-transform: uppercase;
}.month {
margin: 0px 5px 0px 9px;
color: #fff;
display: block;
font-size: 10px;
font-weight:bold;
}.year {
margin: 0px 5px 0px 6px;
display: block;
font-size: 10px;
}.day {
margin: 5px 5px 0px 7px;
display: block;
font-size: 20px;
font-weight:bold;
}
</style>
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:
<body>
9. Just below the code paste the following code:
<!–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–>
This javascript diaplays the date. You can change the order of display in document.write function.
1o. 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 1 year ago
Awesome, thanks so much! Will use this fur sure in a template design!
Reply
about 1 year ago
thank you so much Gautam….
Reply
about 1 year ago
oo. you mean blogger.com or blogspot..
NIce tips and I'll try at my blogspot blog
Reply
about 1 year ago
Nice tutorial. I had my done too. Have a look at http://www.miketok.com
Reply
about 12 months 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 12 months 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 12 months ago
How can i put it in spanish?
Reply
about 12 months ago
@brian: I think you should use spanish as your blog language and then you might see the date in spanish
Reply
about 12 months 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 12 months 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 11 months 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 11 months 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 11 months 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 10 months 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 10 months 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 10 months 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 10 months 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 10 months 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 9 months 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 9 months 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 9 months ago
I've done as you said but it doesn't show anything
Reply
about 8 months 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 6 months 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 5 months 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 5 months 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 4 months 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 4 months 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