Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
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. More... | |
convert_to_gregorian ($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 Gregorian date. More... | |
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. More... | |
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. More... | |
get_days () | |
Returns a list of all the possible days for all months. More... | |
get_max_year () | |
Returns the maximum year for the calendar. More... | |
get_min_year () | |
Returns the minimum year for the calendar. More... | |
get_months () | |
Returns a list of all the names of the months. More... | |
get_name () | |
Returns the name of the calendar. More... | |
get_next_day ($daytimestamp) | |
Get the next day. More... | |
get_next_month ($year, $month) | |
Get the next month. More... | |
get_num_days_in_month ($year, $month) | |
Returns the number of days in a given month. More... | |
get_num_weekdays () | |
Returns the number of days in a week. More... | |
get_prev_day ($daytimestamp) | |
Get the previous day. More... | |
get_prev_month ($year, $month) | |
Get the previous month. More... | |
get_starting_weekday () | |
Returns the index of the starting week day. More... | |
get_weekday ($year, $month, $day) | |
Returns the index of the weekday for a specific calendar date. More... | |
get_weekdays () | |
Returns an indexed list of all the names of the weekdays. More... | |
get_years ($minyear=null, $maxyear=null) | |
Returns an array of years. More... | |
locale_win_charset () | |
This return locale for windows os. More... | |
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. More... | |
timestamp_to_date_string ($time, $format, $timezone, $fixday, $fixhour) | |
Returns a formatted string that represents a date in user time. More... | |
|
abstract |
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 date |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Provided with a day, month, year, hour and minute in the specific calendar type convert it into the equivalent Gregorian date.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute |
array | the converted date |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
core_calendar\type_base::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.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute |
int | timestamp |
|
abstract |
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 in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
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 in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns the maximum year for the calendar.
int | The maximum year |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns the minimum year for the calendar.
int | The minimum year |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns a list of all the names of the months.
array | the month names |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns the name of the calendar.
This is the non-translated name, usually just the name of the calendar folder.
string | the calendar name |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
core_calendar\type_base::get_next_day | ( | $daytimestamp | ) |
Get the next day.
int | $daytimestamp | The day timestamp. |
int | the following day |
|
abstract |
Get the next month.
int | $year | |
int | $month |
array | the following month and year |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns the number of days in a given month.
int | $year | |
int | $month |
int | the number of days |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns the number of days in a week.
int | the number of days |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
core_calendar\type_base::get_prev_day | ( | $daytimestamp | ) |
Get the previous day.
int | $daytimestamp | The day timestamp. |
int | previous day timestamp |
|
abstract |
Get the previous month.
int | $year | |
int | $month |
array | previous month and year |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns the index of the starting week day.
This may vary, for example in the Gregorian calendar, some may consider Monday as the start of the week, where as others may consider Sunday the start.
int |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns the index of the weekday for a specific calendar date.
int | $year | |
int | $month | |
int | $day |
int |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
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 in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns an array of years.
int | $minyear | |
int | $maxyear |
array | the years |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
This return locale for windows os.
string | locale |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
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 in calendartype_test_example\structure, and calendartype_gregorian\structure.
|
abstract |
Returns a formatted string that represents a date in user time.
string | the formatted date/time |
Reimplemented in calendartype_test_example\structure, and calendartype_gregorian\structure.