Calendar script 
Author Message
 Calendar script

I want to create an asp web page using VBScript that reads an access
database containing date entries and creates monthly calendars to display.
Accessing the database is no problem (as well as displaying the database
entries on the asp page), but I am lost as to how to create a calendar to
display (doesn't have to be elaborate, a simple table is fine).  And I don't
know any routines for calculating the correct number of days in a month, the
days of the week, etc.  Any help is appreciated.

Wayne

email:  wayne(no spam)lewis at hotmail.com
(remove the (no spam) and the rest should be obvious)



Sun, 14 Jul 2002 03:00:00 GMT  
 Calendar script

This script (especially the htm portion) is rather rough-edged
(although it does produce a calendar), and it's an HTM rather than ASP
script, but you may be able to tinker around with it to get the
desired results.

<html>
<head>
<title>Create a Monthly Calender</title>
</head>
<body>
<script language="vbscript">
<!--'
Function GetYear
    Do
       Do
          GetYear = Trim(InputBox("Enter a year between" &_
                    " 100 and 9999"))
       Loop Until IsNumeric(GetYear)
    Loop Until GetYear >=100 And GetYear <=9999
    GetYear = Ucase(Calender.Month.Value) & " " & GetYear
End Function

Sub Markup(TheYear)
    document.write "<html><head><title>"
    document.write "Calendar For " & TheYear
    document.write "</title><head>"
    document.write "<body bgcolor=""beige""><center>"
    document.write "<table border=""1"" width=""50%"">"
    document.write "<tr><th colspan=""7"" align=" &_
                   """center""><h2>" & TheYear & "</h2</tr>"
    document.write "<tr><th width=""7%"">SUN"
    document.write "<th width=""7%"">MON"
    document.write "<th width=""7%"">TUE"
    document.write "<th width=""7%"">WED"
    document.write "<th width=""7%"">THU"
    document.write "<th width=""7%"">FRI"
    document.write "<th width=""7%"">SAT</tr><tr>"

    Do While Not Weekday(Left(TheYear,3) & " 1," &_
             Right(TheYear,4)) = Count + 1
       document.Write "<th width=""7%"">&nbsp"
       Count = Count + 1
    Loop

    For NewCount = 1 To 7 - Count
       document.Write "<th width=""7%"">" & NewCount
    Next 'NewCount

    document.write "</tr><tr>"

    For Count = NewCount To 36
       Ctrl = Ctrl + 1
       If IsDate(Left(TheYear,3) & " " & Count & "," &_
                 Right(TheYear,4)) Then
          If Not Ctrl Mod 7 = 0 Then
             document.write "<th width=""7%"">" & Count
          Else
             document.write "<th width=""7%"">" & Count &_
                            "</tr><tr>"
          End If
       ElseIf Ctrl Mod 7 = 1 Then
          Exit For
       Else
          document.write "<th width=""7%"">&nbsp"
       End If
    Next 'Count

    document.write "</tr></table></center></body></html>"
End Sub
-->
</script>
<form method="post" name="Calender">
<h5>Select a month below.</h5>
<select name="Month" onchange="Markup(GetYear)">
<option value="january">january
<option value="january">january
<option value="february">february
<option value="march">march
<option value="april">april
<option value="may">may
<option value="june">june
<option value="july">july
<option value="august">august
<option value="september">september
<option value="october">october
<option value="november">november
<option value="december">december
</select>
</form>
</body>
</html>


: I want to create an asp web page using vbscript that reads an access
: database containing date entries and creates monthly calendars to
display.
: Accessing the database is no problem (as well as displaying the
database
: entries on the asp page), but I am lost as to how to create a
calendar to
: display (doesn't have to be elaborate, a simple table is fine).  And
I don't
: know any routines for calculating the correct number of days in a
month, the
: days of the week, etc.  Any help is appreciated.
:
: Wayne
:
: email:  wayne(no spam)lewis at hotmail.com
: (remove the (no spam) and the rest should be obvious)
:
:



Sun, 14 Jul 2002 03:00:00 GMT  
 Calendar script

A somewhat improved version of the same script. The scripting has been
improved, but the html portion is still rough-edged. :-)

<html>
<head>
<title>Create a Monthly Calendar</title>
</head>
<body bgcolor="beige">
<script language="vbscript">
<!--'
Function GetYear
    Do
       Do
          GetYear = Trim(InputBox("Enter a year between" &_
                    " 100 and 9999"))
       Loop Until IsNumeric(GetYear)
    Loop Until GetYear >=100 And GetYear <=9999
    GetYear = Ucase(Calender.Month.Value) & " " & GetYear
End Function

Sub Markup(TheYear)
    Dim Count
    Dim NewCount
    Document.Write "<html><head><title>"
    Document.Write "Calendar For " & TheYear
    Document.Write "</title><head>"
    Document.Write "<body bgcolor=""beige""><center>"
    Document.Write "<table border=""1"" height=""80%""" &_
                   "width=""80%"">"
    Document.Write "<tr><th colspan=""7"" align=" &_
                   """center""><h2>" & TheYear & "</h2></tr>"
    Document.Write "<tr><th width=""7%"">SUN"
    Document.Write "<th width=""7%"">MON"
    Document.Write "<th width=""7%"">TUE"
    Document.Write "<th width=""7%"">WED"
    Document.Write "<th width=""7%"">THU"
    Document.Write "<th width=""7%"">FRI"
    Document.Write "<th width=""7%"">SAT</tr><tr>"

    Do While Not Weekday(Left(TheYear,3) & " 1," &_
             Right(TheYear,4)) = Count + 1
       Document.Write "<th width=""7%"">&nbsp"
       Count = Count + 1
    Loop

    For NewCount = 1 To 40
       Count = Count + 1
       If IsDate(Left(TheYear,3) & " " & NewCount & "," &_
                 Right(TheYear,4)) Then
          If Not Count Mod 7 = 0 Then
             Document.Write "<th width=""7%"">" & NewCount
          Else
             Document.Write "<th width=""7%"">" &_
                            NewCount & "</tr><tr>"
          End If
       ElseIf Count Mod 7 = 1 Then
          Exit For
       Else
          Document.Write "<th width=""7%"">&nbsp"
       End If
    Next 'NewCount

    Document.Write "</tr></table></center></body></html>"
End Sub
-->
</script>
<form method="post" name="Calender">
<center>
<h5>Select a month below.</h5>
<select name="Month" OnChange="Markup(GetYear)">
<option value="january">january
<option value="january">january
<option value="february">february
<option value="march">march
<option value="april">april
<option value="may">may
<option value="june">june
<option value="july">july
<option value="august">august
<option value="september">september
<option value="october">october
<option value="november">november
<option value="december">december
</select>
</center>
</form>
</body>
</html>



Sun, 14 Jul 2002 03:00:00 GMT  
 Calendar script

Quote:

>I want to create an asp web page using vbscript that reads an access
>database containing date entries and creates monthly calendars to display.
>Accessing the database is no problem (as well as displaying the database
>entries on the asp page), but I am lost as to how to create a calendar to
>display (doesn't have to be elaborate, a simple table is fine).  And I don't
>know any routines for calculating the correct number of days in a month, the
>days of the week, etc.  Any help is appreciated.

>Wayne

Here's a link to just the thing...

http://www.kamath.com/calendar/

Fits *all* your requirements.
    LiL Endian

Quote:
>email:  wayne(no spam)lewis at hotmail.com
>(remove the (no spam) and the rest should be obvious)



Sun, 14 Jul 2002 03:00:00 GMT  
 Calendar script
Thanks.  I'll give this a try.

Wayne


Quote:

> A somewhat improved version of the same script. The scripting has been
> improved, but the html portion is still rough-edged. :-)

> <html>
> <head>
> <title>Create a Monthly Calendar</title>
> </head>
> <body bgcolor="beige">
> <script language="vbscript">
> <!--'
> Function GetYear
>     Do
>        Do
>           GetYear = Trim(InputBox("Enter a year between" &_
>                     " 100 and 9999"))
>        Loop Until IsNumeric(GetYear)
>     Loop Until GetYear >=100 And GetYear <=9999
>     GetYear = Ucase(Calender.Month.Value) & " " & GetYear
> End Function

> Sub Markup(TheYear)
>     Dim Count
>     Dim NewCount
>     Document.Write "<html><head><title>"
>     Document.Write "Calendar For " & TheYear
>     Document.Write "</title><head>"
>     Document.Write "<body bgcolor=""beige""><center>"
>     Document.Write "<table border=""1"" height=""80%""" &_
>                    "width=""80%"">"
>     Document.Write "<tr><th colspan=""7"" align=" &_
>                    """center""><h2>" & TheYear & "</h2></tr>"
>     Document.Write "<tr><th width=""7%"">SUN"
>     Document.Write "<th width=""7%"">MON"
>     Document.Write "<th width=""7%"">TUE"
>     Document.Write "<th width=""7%"">WED"
>     Document.Write "<th width=""7%"">THU"
>     Document.Write "<th width=""7%"">FRI"
>     Document.Write "<th width=""7%"">SAT</tr><tr>"

>     Do While Not Weekday(Left(TheYear,3) & " 1," &_
>              Right(TheYear,4)) = Count + 1
>        Document.Write "<th width=""7%"">&nbsp"
>        Count = Count + 1
>     Loop

>     For NewCount = 1 To 40
>        Count = Count + 1
>        If IsDate(Left(TheYear,3) & " " & NewCount & "," &_
>                  Right(TheYear,4)) Then
>           If Not Count Mod 7 = 0 Then
>              Document.Write "<th width=""7%"">" & NewCount
>           Else
>              Document.Write "<th width=""7%"">" &_
>                             NewCount & "</tr><tr>"
>           End If
>        ElseIf Count Mod 7 = 1 Then
>           Exit For
>        Else
>           Document.Write "<th width=""7%"">&nbsp"
>        End If
>     Next 'NewCount

>     Document.Write "</tr></table></center></body></html>"
> End Sub
> -->
> </script>
> <form method="post" name="Calender">
> <center>
> <h5>Select a month below.</h5>
> <select name="Month" OnChange="Markup(GetYear)">
> <option value="january">january
> <option value="january">january
> <option value="february">february
> <option value="march">march
> <option value="april">april
> <option value="may">may
> <option value="june">june
> <option value="july">july
> <option value="august">august
> <option value="september">september
> <option value="october">october
> <option value="november">november
> <option value="december">december
> </select>
> </center>
> </form>
> </body>
> </html>



Mon, 15 Jul 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Creating calendar event email attachments via server side PHP scripting

2. Script that Exports Outlook Calendar to CSV file

3. shell script for monthly calendars

4. Copy public calendar items to private calendars

5. Calendar Appointment hyperlinks outlook://calendar?

6. synchronise personal calendar to mailbox calendar

7. OL2K Synchronising personal calendar with mailbox calendar

8. synchronize public calendar events to private calendars

9. CALENDARS CALENDARS ALL FREE

10. Adding event to Outlook calendar

11. Calendar ActiveX control

12. Vbscript calendar

 

 
Powered by phpBB® Forum Software