ntMiniCalendar Documentation

Home
About
Documentation
Download

View Demo
 
 Overview 
Requires: ntMiniCalendar.php
Provides: getCalendar(); setAttribute();

ntMiniCalendar is a class written in php to make using a calendar on your site as easy as possible. This documentation was written to aid you in your use of ntMiniCalendar. If at any time you need additional assistance, please use the navigation menu on the left to find contact information regarding the use of this class. If you are looking for examples using this class, there are several implementations that you may view. This documentation is currently being updated, therefore expect some links and information to change.

Documentation version 1.0.5 | Revised: 11/17/2003

 Function Summary 
Return Value Function Name Parameters
Array getCalendar ($yearToGet = -1, $monthToGet = -1, $calDayToHighlight = "")
void setAttribute ($var, $value)

 Function Details 
getCalendar($yearToGet = -1, $monthToGet = -1, $calDayToHighlight = "")

This is the main function for ntMiniCalendar. Returns a formatted calendar, or an unformatted calendar depending on the useDefaultTable variable.

Parameters
$yearToGet (Optional)
This is the year you would like to use to build the calendar (default is current year).
$monthToGet (Optional)
This is the month you would like to use to build the calendar (default is current month).
$calDayToHighlight (Optional)
This is the day you would like to highlight (default is current date).
Back to top
setAttribute ($var, $value)

Sets an environment option. The valid options and values that can be set is listed in the Environment Options section.

Parameters
$var
One of the variables listed in Environment Options.
$value
One of the values listed for each variable listed in Environment Options.
Back to top
 
 Environment Options 
tableHeaderTextcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the text color of the main header of the calendar (i.e., where the month name and year are displayed)
e.g., setAttribute("tableHeaderTextcolor", "#FF0000");
tableHeaderBackcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the background color of the main header of the calendar (i.e., where the month name and year are displayed)
e.g., setAttribute("tableHeaderBackcolor", "#FF0000");
tableItemFullTextcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the text color of the numbers of the calendar (used spaces)
e.g., setAttribute("tableItemFullTextcolor", "#FF0000");
tableItemFullBackcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the background color of the numbers of the calendar (used spaces)
e.g., setAttribute("tableItemFullBackcolor", "#FF0000");
todayTextcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the text color of the current day
e.g., setAttribute("todayTextcolor", "#FF0000");
todayBackcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the background color of the current day
e.g., setAttribute("todayBackcolor", "#FF0000");
tableItemEmptyBackcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the background color of the unused spaces on the calendar
e.g., setAttribute("tableItemEmptyBackcolor", "#FF0000");
dayOfWeekBackgroundcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the background color of the used spaces on the calendar
e.g., setAttribute("dayOfWeekBackgroundcolor", "#FF0000");
dayOfWeekHeaderBackgroundcolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the background color of the headers used to identify the days of the week
e.g., setAttribute("dayOfWeekHeaderBackgroundcolor", "#FF0000");
tableBordercolor
Hex Value
Valid ranges: #000000 - #FFFFFF
Sets the color of the borders used in the calendar (ignored if tableBorderWidth is set to 0)
e.g., setAttribute("tableBordercolor", "#FF0000");
tableBorderWidth
Decimal Value
Valid Settings: [number]
Sets the width of the borders in the calendar (0 for no borders)
e.g., setAttribute("tableBorderWidth", "1");
useDefaultTable
Boolean Value
Valid Settings: TRUE, FALSE
Sets whether or not to build a table around the calendar
e.g., setAttribute("useDefaultTable", TRUE);
fullWeekdayNames
Boolean Value
Valid Settings: TRUE, FALSE
Sets whether or not to use the full weekday names or one letter abbreviations
e.g., setAttribute("fullWeekdayNames", TRUE);
calFontSize
Decimal Value
Valid Settings: [number]
Sets the font size to use for the calendar
e.g., setAttribute("calFontSize", "10");
calHeaderFontSize
Decimal Value
Valid Settings: [number]
Sets the font size to use for the header of the calendar
e.g., setAttribute("calHeaderFontSize", "10");
cellWidth
Decimal Value
Valid Settings: [number]px, [number], [number]%, *
Sets the width (in pixels or percentage) of the cells used for the days of the week
e.g., setAttribute("cellWidth", "20");
cellHeight
Decimal Value
Valid Settings: [number]px, [number], [number]%, *
Sets the height (in pixels or percentage) of the cells used for the days of the week
e.g., setAttribute("cellHeight", "*");
calFontName
String
Valid Settings: Any installed font name
Sets the font to be used in the calendar
e.g., setAttribute("calFontName", "Helvetica");
calHighlightToday
Boolean Value
Valid Settings: TRUE, FALSE
Sets whether or not to highlight the current day of the week (or the date passed via $calDayToHighlight)
e.g., setAttribute("calHighlightToday", TRUE);
calDateAlign
String
Valid Settings: left, right, center
Sets the horizontal alignment of the dates in the calendar
e.g., setAttribute("calDateAlign", "center");
calDateVAlign
String
Valid Settings: top, middle, bottom
Sets the vertical alignment of the dates in the calendar
e.g., setAttribute("calDateVAlign", "middle");
calWeekHeaderWidth
Decimal Value
Valid Settings: [number]px, [number], [number]%, *
Sets the width (in pixels or percentage) of the cells used for the days of the week headers
e.g., setAttribute("calWeekHeaderWidth", "20");
calWeekHeaderHeight
Decimal Value
Valid Settings: [number]px, [number], [number]%, *
Sets the height (in pixels or percentage) of the cells used for the days of the week headers
e.g., setAttribute("calWeekHeaderHeight", "*");
calWeekHeaderAlign
String
Valid Settings: left, right, center
Sets the horizontal alignment of the headers of the week
e.g., setAttribute("calWeekHeaderAlign", "center");
calWeekHeaderVAlign
String
Valid Settings: top, middle, bottom
Sets the vertical alignment of the headers of the week
e.g., setAttribute("calWeekHeaderVAlign", "middle");
calPadding
Decimal Value
Valid Settings: [number]
Sets the cell padding to be used in the calendar
e.g., setAttribute("calPadding", "2");
calHeaderLink
URL
Valid Settings: Any fully qualified url.
Sets a url to be used with the calendar header (where the month name and year are displayed)
e.g., setAttribute("calHeaderLink", "http://www.foo.com/mycalendar.php");
calDayOfWeekLink
URL
Valid Settings: Any fully qualified url.
Sets the url to be used for the numeric days of the week
e.g., setAttribute("calDayOfWeekLink", "http://www.foo.com/mycalendar.php");
calUseDayOfWeekLink
Boolean Value
Valid Settings: TRUE, FALSE
Sets whether or not to use the link specified in calDayOfWeekLink
e.g., setAttribute("calUseDayOfWeekLink", TRUE);
calDayLinkYearVar
String
Valid Settings: [0-9a-zA-Z_-]
Sets the variable to be used for returning the year
e.g., setAttribute("calDayLinkYearVar", "year");
calDayLinkMonthVar
String
Valid Settings: [0-9a-zA-Z_-]
Sets the variable to be used for returning the month
e.g., setAttribute("calDayLinkMonthVar", "month");
calDayLinkDayVar
String
Valid Settings: [0-9a-zA-Z_-]
Sets the variable to be used for returning the day
e.g., setAttribute("calDayLinkDayVar", "day");
Back to top
 
 Formatted Calendar 
include_once("ntMiniCalendar.php");
$ntMiniCal = new ntMiniCalendar;
$foo = $ntMiniCal->getCalendar();
unset($ntMiniCal);
echo $foo;

February - 2012
SMTWTFS
   1234
567891011
12131415161718
19202122232425
26272829   
Back to top
 
 Unformatted Calendar 
include_once("ntMiniCalendar.php");
$ntMiniCal = new ntMiniCalendar;
$ntMiniCal->setAttribute("useDefaultTable", FALSE);
$foo = $ntMiniCal->getCalendar();
unset($ntMiniCal);
print_r($foo);
Array
(
    [calenderStartDay] => 3
    [1] => Array
        (
            [1] => 0
            [2] => 0
            [3] => 0
            [4] => 1
            [5] => 2
            [6] => 3
            [7] => 4
        )

    [2] => Array
        (
            [1] => 5
            [2] => 6
            [3] => 7
            [4] => 8
            [5] => 9
            [6] => 10
            [7] => 11
        )

    [3] => Array
        (
            [1] => 12
            [2] => 13
            [3] => 14
            [4] => 15
            [5] => 16
            [6] => 17
            [7] => 18
        )

    [4] => Array
        (
            [1] => 19
            [2] => 20
            [3] => 21
            [4] => 22
            [5] => 23
            [6] => 24
            [7] => 25
        )

    [5] => Array
        (
            [1] => 26
            [2] => 27
            [3] => 28
            [4] => 29
            [5] => 0
            [6] => 0
            [7] => 0
        )

    [6] => Array
        (
            [1] => 0
            [2] => 0
            [3] => 0
            [4] => 0
            [5] => 0
            [6] => 0
            [7] => 0
        )

)
Back to top