How to Add a Basic Calendar Widget To Blogger

This is one of the most common widgets you can see on a blog. These are rare in Blogger blogs, as Blogger doesn't directly gives you the facility to add them.

You can see my previous post, on how to add archive calendar widget, in your blog.

In this post, I will help you to add a Basic calendar. This widget shows you the entire year calendar dynamically. You can select any month of the current year with the help of a drop down menu.

You can see the demo by clicking the below button:

How to add this gadget to your blog:

Log in to

Go to Dashboard>Layout 

Click on Add a Gadget

Copy and Paste below code as a HTML/JavaScript widget.

<style type="text/css">

.main {
border:1px solid black;

.month {
font:bold 12px verdana;

.daysofweek {
font:bold 12px verdana;

.days {
font-size: 12px;
background-color: lightyellow;
padding: 2px;

.days #today{
font-weight: bold;
color: red;


<script type="text/javascript" src="">
* Basic Calendar-By Brian Gosselin at
* Script featured on Dynamic Drive (
* Via
* This notice must stay intact for use
* Visit for full source code

<select onChange="updatecalendar(this.options)">
<script type="text/javascript">

var themonths=['January','February','March','April','May','June',

var todaydate=new Date()
var curmonth=todaydate.getMonth()+1 //get current month (1-12)
var curyear=todaydate.getFullYear() //get current year

function updatecalendar(theselection){
var themonth=parseInt(theselection[theselection.selectedIndex].value)+1
var calendarstr=buildCal(themonth, curyear, "main", "month", "daysofweek", "days", 0)
if (document.getElementById)

document.write('<option value="'+(curmonth-1)+'" selected="yes">Current Month</option>')
for (i=0; i<12; i++) //display option for 12 months of the year
document.write('<option value="'+i+'">'+themonths[i]+' '+curyear+'</option>')


<div id="calendarspace">
//write out current month's calendar to start
document.write(buildCal(curmonth, curyear, "main", "month", "daysofweek", "days", 1))


Save the widget, and your blog will be ready with a new calendar!


You can adjust the width of the calendar as to fit it exactly you wanted it in you blog. For this you can change the width pixel above in RED.

Try this out…Enjoy!!

{ 0 comments... read them below or add one }

Post a Comment