...

View Full Version : Custom JavaScript Calendar



chandanp
03-27-2012, 12:08 PM
Hi,
I want to build a custom calendar using javascript.
On load of page for which date schedule are there, it should show dark black dot at left-top corner of particular date for current month.
There are 3 button below the calendar as prev mnth,create schedule,next mnth.
when prev is clicked it should works same as on load for previous month, similarly for next mnth.

Pls help its urgent.

Thanks

Philip M
03-27-2012, 02:47 PM
This forum is not a free coding service nor an arm of social security. There are very many excellent scripts for calendars out there.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

mrhoo
03-27-2012, 04:23 PM
I had some trouble with Easter, and got some help with the math,
so I'll give you a hand there:


Date.getEaster= function(y){
var D= y? new Date(y, 1): new Date();
y= D.getFullYear();
if(y> 1583){
var X= Math.floor, a= y%19, b= X(y/100), c= y%100,
d= X(b/4), e= b%4, f= X((b+8)/25), g= X((b-f+1)/3),
h= (19*a+b-d-g+15)%30, i= X(c/4), k= c%4,
l= (32 + 2*e + 2*i - h - k)%7,
m= X((a + 11*h + 22*l)/451),
n= X((h + l - 7*m + 114)/31),
p= (h + l - 7*m + 114)%31;
D.setMonth(n-1, p+1);
if(D.getDay()=== 0) return D;
}
return false;
};




// (non standard methods to display a range of dates-
//you can use a for loop and localeDateString)
Array.range(1990, 2020).map(function(itm){
return Date.getEaster(itm).dayString('yb')
}).join('\n');

/* returned values:
15 April, 1990
31 March, 1991
19 April, 1992
11 April, 1993
3 April, 1994
16 April, 1995
7 April, 1996
30 March, 1997
12 April, 1998
4 April, 1999
23 April, 2000
15 April, 2001
31 March, 2002
20 April, 2003
11 April, 2004
27 March, 2005
16 April, 2006
8 April, 2007
23 March, 2008
12 April, 2009
4 April, 2010
24 April, 2011
8 April, 2012
31 March, 2013
20 April, 2014
5 April, 2015
27 March, 2016
16 April, 2017
1 April, 2018
21 April, 2019
12 April, 2020
*/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum