Calendar



'JavaScript' Больше, чем просто сайт!.

Here is a simple calendar. It's implemented using JavaScript only. All you need is to place three lines in to your HTML file:

	<script language="javascript" src="calendar.js"></script>
	<link rel="stylesheet" href="calendar.css" type="text/css">
	<script language=javascript>  print_calendar("");</script>
	

The first line is to include calendar code in to your page.

The third line is to draw the calendar. Put this line in that position where the calendar should be drawn. Parameter for print_calendar function is the current date to be dispalyed

On the second line one include description on how your calendar should look like. Here you should describe the folowing CSS classes:
  1. cal_bg
  2. cal_table
  3. cal_date_table
  4. cal_dayofweek_row
  5. cal_dayofweek
  6. cal_prev_month_date
  7. cal_next_month_date
  8. cal_this_month_date
  9. cal_goto_prev_month
  10. cal_goto_next_month
  11. cal_month

By pressing on areas 9 and 10, you can switch calendar to the previos and next month accordingly.

If user define user_day_selected(Date) function, this function would be execute each time user clicked on date (areas 5, 7, 8). the folowing function defined on this page:

  function user_day_selected(date){
    alert(date);
  }