Forums: Minicalendar - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Minicalendar

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15471
  • Joined: 03-February 03

Posted 03 December 2007 - 05:10 PM

Example:
Live demo

Add the following code to any HTML/ASP/PHP file to display a minicalendar.

Parameters:
var my_url='http://www.yourwebsite.com/calendar/'; - base URL of your Calendar application
var my_ext='asp'; - file extension. asp for ASPRunnerPro, php for PHPRunner.

<script>
var my_url='http://www.yourwebsite.com/calendar/';
var my_ext='php';
var my_mont = new Array(13);
my_mont[1]="January";
my_mont[2]="February";
my_mont[3]="March";
my_mont[4]="April";
my_mont[5]="May";
my_mont[6]="June";
my_mont[7]="July";
my_mont[8]="August";
my_mont[9]="September";
my_mont[10]="October";
my_mont[11]="November";
my_mont[12]="December";

var my_mdays = new Array(13);
my_mdays[1]=31;
my_mdays[2]=28;
my_mdays[3]=31;
my_mdays[4]=30;
my_mdays[5]=31;
my_mdays[6]=30;
my_mdays[7]=31;
my_mdays[8]=31;
my_mdays[9]=30;
my_mdays[10]=31;
my_mdays[11]=30;
my_mdays[12]=31;

var sDate = new Date();
var nDate = new Date(sDate.getFullYear(),sDate.getMonth(),1);
var wd=nDate.getDay();
if(wd==0)
        wd=7;
var mon1=sDate.getMonth();
var mon2=sDate.getMonth()+2;
var year1=sDate.getFullYear();
var year2=sDate.getFullYear();
if(mon1==0)
{
        mon1=12;
        year1=year1-1;
}

if(mon2==13)
{
        mon2=1;
        year2=year2+1;
}       
</script>
<style>
a.my_link,a.my_link:visited
{
color: black;
TEXT-DECORATION: none;
}
</style>
<table cellpadding=0 cellspacing=0 border=0 width=161 style="border:1px solid blue;font-family: Verdana, Arial, Helvetica, sans serif;font-size: 11px;">
<tr>
<td colspan=8 align=center height=25 style="background-color:#E6EDF8">
<a class=my_link href="" onclick="location.href=my_url+'calmonthly_list.'+my_ext+'?mon='+mon1+'&yr='+year1;return false;" style="TEXT-DECORATION: none;"><</a>
<a class=my_link href="" onclick="window.location.href=my_url+'calmonthly_list.'+my_ext+'?mon='+(sDate.getMonth()+1)+'&yr='+sDate.getFullYear(); return false;" style="TEXT-DECORATION: none;">
<b><script>document.write(my_mont[sDate.getMonth()+1]);</script></b></a>
 <b><script>document.write(sDate.getFullYear());</script></b>
<a class=my_link href="" onclick="location.href=my_url+'calmonthly_list.'+my_ext+'?mon='+mon2+'&yr='+year2;return false;" style="TEXT-DECORATION: none;">></a>
</td>
</tr>
<tr style="background-color:#D1DBE7" align=center><td></td></td><td>Mo</td><td>Tu</td><td>We</td><td>Th</td><td>Fr</td><td>Sa</td><td>Su</td></tr>
<script>
var d=1;
var c2;
var b;
var c;
var link;
for(i=1;i<=6;i++)
{
        document.write("<tr>");
        document.write("<td width=5 style='background-color:#D1DBE7'>");
        document.write("<a class=my_link href='" + my_url + "calweekly_list."+my_ext+"?mon=" + (sDate.getMonth()+1) + "&yr=" + sDate.getFullYear() + "&days=" + ((i-1)*7+1) + "'>></a>");
        document.write("</td>");
        for(j=1;j<=7;j++)
        {
                c2="#F7F9FB";
                if(j>5)
                        c2="#D1DBE7";
                c="#cccccc";
                b=1;
                if(d==sDate.getDate())
                {
                        c="#990000";
                        b=2;
                }
                if(d<=my_mdays[sDate.getMonth()+1])
                {
                        link="<a class=my_link href='" + my_url + "caldaily_list."+my_ext+"?mon=" + (sDate.getMonth()+1) + "&yr=" + sDate.getFullYear() + "&days=" + d + "'>";
                        if(i==1)
                        {
                                if(j>=wd)
                                {
                                        document.write("<td width=20 align=center style='border:" + b + "px solid " + c + ";background-color:" + c2 + "' height=20>");
                                        document.write(link + d + "</a>");
                                        d=d+1;
                                }
                                else
                                {
                                        document.write("<td width=20 align=center style='border:1px solid " + c + ";background-color:#F2F2F2' height=20>");
                                        document.write(" ");
                                }
                        }
                        else
                        {
                                document.write("<td width=20 align=center style='border:" + b + "px solid " + c + ";background-color:" + c2 + "' height=20>");
                                document.write(link + d + "</a>");
                                d=d+1;
                        }
                }
                else
                {
                        document.write("<td width=20 align=center style='border:1px solid " + c + ";background-color:#F2F2F2' height=20>");
                        document.write(" ");
                }
                if(j==7 && 7+(i-1)*7>=my_mdays[sDate.getMonth()+1])
                {
                        i=10;
                        j=10;
                }
                document.write("</td>");
        }
        document.write("</tr>");
}
 </script>
<tr><td colspan=8 align=center style="font-family: Verdana, Arial, Helvetica, sans serif;font-size: 9px;background-color:#E6EDF8;">Today is 
<script>
document.write(my_mont[sDate.getMonth()+1]);
document.write(" ");
document.write(sDate.getDate());
document.write(", ");
document.write(sDate.getFullYear());
</script>
</td></tr>
</table>

Best regards,
Sergey Kornilov
0

#2 User is offline   michaelmac 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 87
  • Joined: 21-April 07

Post icon  Posted 04 January 2008 - 04:39 PM

Hey Tech Support

This is a dumb question, where is a good spot to add this code?

Thanks

Mike
0

#3 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15471
  • Joined: 03-February 03

Posted 10 January 2008 - 05:23 AM

You put this code where you like minicalendar to appear.
Best regards,
Sergey Kornilov
0

#4 User is offline   dunga 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 285
  • Joined: 15-March 06

Posted 21 February 2008 - 08:29 PM

demo link is not working...
0

#5 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15471
  • Joined: 03-February 03

Posted 22 February 2008 - 06:11 PM

Thank you, fixed.
Best regards,
Sergey Kornilov
0

#6 User is offline   Yvolution-Zone 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 09-February 10

Posted 24 February 2010 - 07:57 PM

I am a new user and I would like to know if you got the calendar object to display after inserting the 2 lines of code proposed by support in your article?

Thanks
0

#7 User is offline   kleanthis 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 49
  • Joined: 23-April 09

Posted 30 October 2013 - 10:30 AM

still the demo link is not working...
0

#8 User is offline   Maverick 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 156
  • Joined: 13-February 14

Posted 27 February 2014 - 07:50 AM

It looks like the February 2014 calendar I just bought has not been changed or improved since 2008 or 2007.

There is no Calendar File export for ICS as was promised for the next version in 2008.

When I tried the miniature calendar example in this post in the calendar I installed this past week (it is now February 27, 2014) the links fail because they all refer to a page that does not exist in the calendar folders.

Calendar/Daily_list.php?

in my calendar all pages are lowercase and none of the files show a list page for the daily htm template.

When will this calendar have some new attention and upgrades applied, please?
0

#9 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15471
  • Joined: 03-February 03

Posted 03 March 2014 - 08:38 PM

Minicalendar code and demo were updated.

We update Calendar template every time new version of PHPRunner/ASPRunnerPro/ASPRunner.NET is released.
Best regards,
Sergey Kornilov
0

#10 User is offline   Maverick 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 156
  • Joined: 13-February 14

Posted 04 March 2014 - 06:47 PM

Can you provide a revision for this mini calendar that makes it work for the last version of the Calendar Template as of 2014?

The caldaily_list file does not exist in the Bricks/ path.

link="<a class=my_link href='" + my_url + "caldaily_list."+my_ext+"?


Thank you.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic