friendica_2021.01_tupambae_.../include/datetime.php

50 lines
1.3 KiB
PHP
Raw Normal View History

2010-07-02 01:48:07 +02:00
<?php
2016-02-03 19:48:09 +01:00
/**
* @file include/datetime.php
* @brief Some functions for date and time related tasks.
*/
2010-07-02 01:48:07 +02:00
use Friendica\Model\Contact;
use Friendica\Util\Temporal;
2010-09-27 09:38:26 +02:00
function dob($dob) {
return Temporal::getDateofBirthField($dob);
}
function datesel($min, $max, $default, $id = 'datepicker') {
return Temporal::getDateField($min, $max, $default, $id);
2016-02-03 19:48:09 +01:00
}
2010-07-02 01:48:07 +02:00
function timesel($h, $m, $id = 'timepicker') {
return Temporal::getTimeField($h, $m, $id);
2016-02-03 19:48:09 +01:00
}
2011-06-07 04:59:20 +02:00
function datetimesel($min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
return Temporal::getDateTimeField($min, $max, $default, $label, $id, $pickdate, $picktime, $minfrom, $maxfrom, $required);
2016-02-03 19:48:09 +01:00
}
2010-07-02 01:48:07 +02:00
function relative_date($posted_date, $format = null) {
return Temporal::getRelativeDate($posted_date, $format);
2016-02-03 19:48:09 +01:00
}
2010-09-27 09:38:26 +02:00
function age($dob, $owner_tz = '', $viewer_tz = '') {
return Temporal::getAgeByTimezone($dob, $owner_tz, $viewer_tz);
2010-07-10 07:47:32 +02:00
}
2011-02-23 05:08:15 +01:00
function get_dim($y, $m) {
return Temporal::getDaysInMonth($y, $m);
2016-02-03 19:48:09 +01:00
}
2011-02-23 05:08:15 +01:00
2016-02-03 19:48:09 +01:00
function get_first_dim($y,$m) {
return Temporal::getFirstDayInMonth($y, $m);
2016-02-03 19:48:09 +01:00
}
2011-02-23 05:08:15 +01:00
function cal($y = 0, $m = 0, $links = null, $class = '')
{
return Temporal::getCalendarTable($y, $m, $links, $class);
2016-02-03 19:48:09 +01:00
}
2011-10-14 09:20:37 +02:00
function update_contact_birthdays() {
return Contact::updateBirthdays();
}