Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Public Member Functions | |
convert_from_gregorian ($year, $month, $day, $hour=0, $minute=0) | |
Provided with a day, month, year, hour and minute in a Gregorian date convert it into the specific calendar type date. | |
convert_to_gregorian ($year, $month, $day, $hour=0, $minute=0) | |
Provided with a day, month, year, hour and minute convert it into the equivalent Gregorian date. | |
convert_to_timestamp ($year, $month, $day, $hour=0, $minute=0) | |
Provided with a day, month, year, hour and minute in the specific calendar type convert it into the equivalent Unix Time Stamp. | |
get_date_order ($minyear=null, $maxyear=null) | |
Returns a multidimensional array with information for day, month, year and the order they are displayed when selecting a date. | |
get_days () | |
Returns a list of all the possible days for all months. | |
get_max_year () | |
Returns the maximum year for the calendar. | |
get_min_year () | |
Returns the minimum year for the calendar. | |
get_months () | |
Returns a list of all the names of the months. | |
get_name () | |
Returns the name of the calendar. | |
get_next_day ($daytimestamp) | |
Get the next day. | |
get_next_month ($year, $month) | |
Get the next month. | |
get_num_days_in_month ($year, $month) | |
Returns the number of days in a given month. | |
get_num_weekdays () | |
Returns the number of days in a week. | |
get_prev_day ($daytimestamp) | |
Get the previous day. | |
get_prev_month ($year, $month) | |
Get the previous month. | |
get_starting_weekday () | |
Returns the index of the starting week day. | |
get_weekday ($year, $month, $day) | |
Returns the index of the weekday for a specific calendar date. | |
get_weekdays () | |
Returns an indexed list of all the names of the weekdays. | |
get_years ($minyear=null, $maxyear=null) | |
Returns an array of years. | |
locale_win_charset () | |
This return locale for windows os. | |
timestamp_to_date_array ($time, $timezone=99) | |
Given a $time timestamp in GMT (seconds since epoch), returns an array that represents the date in user time. | |
timestamp_to_date_string ($time, $format, $timezone, $fixday, $fixhour) | |
Returns a formatted string that represents a date in user time. | |
calendartype_test_example\structure::convert_from_gregorian | ( | $year, | |
$month, | |||
$day, | |||
$hour = 0, | |||
$minute = 0 ) |
Provided with a day, month, year, hour and minute in a Gregorian date convert it into the specific calendar type date.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute |
array | the converted day, month, year, hour and minute. |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::convert_to_gregorian | ( | $year, | |
$month, | |||
$day, | |||
$hour = 0, | |||
$minute = 0 ) |
Provided with a day, month, year, hour and minute convert it into the equivalent Gregorian date.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute |
array | the converted day, month, year, hour and minute. |
Reimplemented from core_calendar\type_base.
|
inherited |
Provided with a day, month, year, hour and minute in the specific calendar type convert it into the equivalent Unix Time Stamp.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute |
int | timestamp |
calendartype_test_example\structure::get_date_order | ( | $minyear = null, | |
$maxyear = null ) |
Returns a multidimensional array with information for day, month, year and the order they are displayed when selecting a date.
The order in the array will be the order displayed when selecting a date. Override this function to change the date selector order.
int | $minyear | The year to start with. |
int | $maxyear | The year to finish with. |
array | Full date information. |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_days | ( | ) |
Returns a list of all the possible days for all months.
This is used to generate the select box for the days in the date selector elements. Some months contain more days than others so this function should return all possible days as we can not predict what month will be chosen (the user may have JS turned off and we need to support this situation in Moodle).
array | the days |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_max_year | ( | ) |
Returns the maximum year for the calendar.
int | The maximum year |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_min_year | ( | ) |
Returns the minimum year for the calendar.
int | The minimum year |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_months | ( | ) |
Returns a list of all the names of the months.
array | the month names |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_name | ( | ) |
Returns the name of the calendar.
string | the calendar name |
Reimplemented from core_calendar\type_base.
|
inherited |
Get the next day.
int | $daytimestamp | The day timestamp. |
int | the following day |
calendartype_test_example\structure::get_next_month | ( | $year, | |
$month ) |
Get the next month.
If the current month is December, it will get the first month of the following year.
int | $year | |
int | $month |
array | the following month and year |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_num_days_in_month | ( | $year, | |
$month ) |
Returns the number of days in a given month.
int | $year | |
int | $month |
int | the number of days |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_num_weekdays | ( | ) |
Returns the number of days in a week.
int | the number of days |
Reimplemented from core_calendar\type_base.
|
inherited |
Get the previous day.
int | $daytimestamp | The day timestamp. |
int | previous day timestamp |
calendartype_test_example\structure::get_prev_month | ( | $year, | |
$month ) |
Get the previous month.
If the current month is January, it will get the last month of the previous year.
int | $year | |
int | $month |
array | previous month and year |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_starting_weekday | ( | ) |
Returns the index of the starting week day.
int |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_weekday | ( | $year, | |
$month, | |||
$day ) |
Returns the index of the weekday for a specific calendar date.
int | $year | |
int | $month | |
int | $day |
int |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_weekdays | ( | ) |
Returns an indexed list of all the names of the weekdays.
The list starts with the index 0. Each index, representing a day, must be an array that contains the indexes 'shortname' and 'fullname'.
array | array of days |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::get_years | ( | $minyear = null, | |
$maxyear = null ) |
Returns an array of years.
int | $minyear | |
int | $maxyear |
array | the years. |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::locale_win_charset | ( | ) |
This return locale for windows os.
string | locale |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::timestamp_to_date_array | ( | $time, | |
$timezone = 99 ) |
Given a $time timestamp in GMT (seconds since epoch), returns an array that represents the date in user time.
int | $time | timestamp in GMT |
float | int | string | $timezone | the timezone to use to calculate the time |
array | an array that represents the date in user time |
Reimplemented from core_calendar\type_base.
calendartype_test_example\structure::timestamp_to_date_string | ( | $time, | |
$format, | |||
$timezone, | |||
$fixday, | |||
$fixhour ) |
Returns a formatted string that represents a date in user time.
string | the formatted date/time |
Reimplemented from core_calendar\type_base.