I've attached the beginnings of a community calendar I've been working on.  
The calendar arithmetic, which is the tricky part, has been taken care of.

The style design needs work.

The rest of the typical featuers, e.g. events, should probably be handled 
separately, with a DB, etc.

On Tuesday 19 August 2003 3:33 pm, Rick Roberts wrote:
> Anyone know of a decent calendar tool / server that would integrate well
> with java/jsp/jdbc/tomcat?
>
> Thanks,

-- 
Pablo Mayrgundter
Director of Applications and Services
www.reeltwo.com
<[EMAIL PROTECTED] import="java.text.*, java.util.*" %>
<jsp:include page="header.html.part" />
<%
  Date d = new Date();
  SimpleDateFormat df = new SimpleDateFormat();
  GregorianCalendar monthCal = new GregorianCalendar();
  monthCal.setTime(d);
  monthCal.set(monthCal.DAY_OF_MONTH, 1);
  GregorianCalendar utilCal = new GregorianCalendar();
  utilCal.setTime(monthCal.getTime());
  df.applyPattern("MMMMMMMMMM yyyy");
%>
  <center>
    <h1>Community Calendar</h1>
    <h2><%= df.format(d) %></h2>
    <table width="75%" height="75%" cellpadding="5" cellspacing="0" class="calendar">
<%
  // Set calendars back to the Sunday preceeding the 1st.
  do {
    monthCal.roll(monthCal.DAY_OF_WEEK, false);
    utilCal.roll(monthCal.DAY_OF_WEEK, false);
  } while(monthCal.get(monthCal.DAY_OF_WEEK) != monthCal.SUNDAY);

  // Write out the calendar.
  df.applyPattern("EEEEEEEEE");
  for (int week = 0; week < 7; week++) {
%>
      <tr>
<%
    for (int day = 0; day < 7; day++) {
      if (week == 0) {
%>
     <th width="14%" height="5%"><%= df.format(utilCal.getTime()) %></th>
<%
        utilCal.roll(utilCal.DAY_OF_WEEK, true);
      } else {
%>
     <td height="15.8%" align="left" valign="top"><%= 
monthCal.get(monthCal.DAY_OF_MONTH) %></td>
<%
        monthCal.roll(monthCal.DAY_OF_MONTH, true);
      }
    }
%>
      </tr>
<%
  }
%>
    </table>
  </center>
<jsp:include page="footer.html.part" />
.calendar th {
  background-color: #ccc;
}

.calendar td {
  padding: 3px;
  border: solid 1px black;
  font-size: 8pt;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to