working code on rendering calender