Class Calendar
Construct the calendar data and render calendar HTML by using template.
Package: Calendar
Author: Vee W.
Version: 2.0
Located at Calendar/Calendar.php
public
|
|
public
string
|
|
public
array
|
#
getCalendarData( string $scope = 'month' )
Get the calendar data with specified scope. |
public
array
|
|
public
boolean
|
#
setEvents( array $events )
Set the events to display in calendar. $events = array( array( 'date_from' => '2016-04-28 09:00:00',// Required array key 'date_to' => '2016-04-28 09:40:00',// Required array key 'title' => 'My event 1',// Not required but up to your calendar design. ), array( 'date_from' => '2016-04-28 15:20:00',// Required array key 'date_to' => '2016-04-28 15:50:00',// Required array key 'title' => 'My event 2',// Not required but up to your calendar design. ), ); The value of date_from and date_to must be Year-Month-Date, the time may not required if you did not display calendar in day scope. |
public
mixed
|
#
weeksInMonth( string $month, string $year, integer $first_day_of_week = 0 )
Get total weeks in a month |
public
sting
|
$base_url
Base URL for use with link to navigate the date. |
|
public
string
|
$viewing_date
Set the currently viewing date. |
|
protected
string
|
$original_viewing_date
The original value of viewing_date property before it was changed. This is useful in the class while using loop to set viewing date and get the calendar's data. |
|
public
integer
|
$first_day_of_week
First day of week. (0 = Sunday, 1 = Monday, 2 = Tuesday, ..., 6 = Saturday) |
#
0
|
public
mixed
|
$locale
Locale for use with setlocale() function. See more at http://php.net/manual/en/function.setlocale.php |
#
array('th_TH.utf8', 'th_TH.UTF8', 'th_TH.utf-8', 'th_TH.UTF-8', 'th-TH.utf8', 'th-TH.UTF8', 'th-TH.utf-8', 'th-TH.UTF-8', 'th_TH', 'th-TH', 'th')
|
public
constant
|
$locale_category
Locale category. See more at http://php.net/manual/en/function.setlocale.php |
#
LC_TIME
|
public
boolean
|
$use_buddhist_era
Use Buddhist era or not? Set to true to use Buddhist era, false not to use. |
#
true
|
public
integer
|
$buddhist_era_offset
Buddhist era year offset. For Thailand we use +543. |
#
543
|
public
integer
|
$buddhist_era_offset_short
Buddhist era year offset (in short or 2 digit number). For Thailand we use +43. |
#
43
|
protected
array
|
$events
The events that will be appears in calendar, or it can be appointments. |