Class CI_Calendar - echiong/testRepo GitHub Wiki

##Class CI_Calendar

CodeIgniter Calendar Class

This class enables the creation of calendars

Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category: Libraries
Author: ExpressionEngine Dev Team
Link: http://codeigniter.com/user_guide/libraries/calendar.html
Located at system/libraries/Calendar.php

##Methods summary


public __construct ( mixed $config = array() )

Constructor

Loads the calendar language file and sets the default time reference


public initialize ( array $config = array() )

Initialize the user preferences

Accepts an associative array as input, containing display preferences

Parameters

$config array
config preferences


public string generate ( integer $year = '', integer $month = '', array $data = array() )

Generate the calendar

Parameters

$year integer
the year

$month integer
the month

$data array
the data to be shown in the calendar cells

Returns string


public string get_month_name ( integer $month )

Get Month Name

Generates a textual month name based on the numeric month provided.

Parameters

$month integer
the month

Returns string


public array get_day_names ( string $day_type = '' )

Get Day Names

Returns an array of day names (Sunday, Monday, etc.) based on the type. Options: long, short, abrev

Parameters

$day_type string

Returns array


public array adjust_date ( integer $month, integer $year )

Adjust Date

This function makes sure that we have a valid month/year. For example, if you submit 13 as the month, the year will increment and the month will become January.

Parameters

$month integer
the month

$year integer
the year

Returns array


public integer get_total_days ( integer $month, integer $year )

Total days in a given month

Parameters

$month integer
the month

$year integer
the year

Returns integer


public array default_template ( )

Set Default Template Data

This is used in the event that the user has not created their own template

Returns array


public parse_template ( )

Parse Template

Harvests the data within the template {pseudo-variables} used to display the calendar

<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="CI" id="$CI">
	<td class="attributes"><code>
		public  
		mixed
	</code></td>

	<td class="name">

$CI

#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="lang" id="$lang">
	<td class="attributes"><code>
		public  
		mixed
	</code></td>

	<td class="name">

$lang

#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="local_time" id="$local_time">
	<td class="attributes"><code>
		public  
		mixed
	</code></td>

	<td class="name">

$local_time

#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="template" id="$template">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$template

''
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="start_day" id="$start_day">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$start_day

'sunday'
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="month_type" id="$month_type">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$month_type

'long'
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="day_type" id="$day_type">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$day_type

'abr'
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="show_next_prev" id="$show_next_prev">
	<td class="attributes"><code>
		public  
		boolean
	</code></td>

	<td class="name">

$show_next_prev

FALSE
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="next_prev_url" id="$next_prev_url">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$next_prev_url

''
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
</table>
⚠️ **GitHub.com Fallback** ⚠️