3 * @file include/datetime.php
4 * @brief Some functions for date and time related tasks.
7 use Friendica\Model\Contact;
8 use Friendica\Util\Temporal;
11 return Temporal::getDateofBirthField($dob);
14 function datesel($min, $max, $default, $id = 'datepicker') {
15 return Temporal::getDateField($min, $max, $default, $id);
18 function timesel($h, $m, $id = 'timepicker') {
19 return Temporal::getTimeField($h, $m, $id);
22 function datetimesel($min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
23 return Temporal::getDateTimeField($min, $max, $default, $label, $id, $pickdate, $picktime, $minfrom, $maxfrom, $required);
26 function relative_date($posted_date, $format = null) {
27 return Temporal::getRelativeDate($posted_date, $format);
30 function age($dob, $owner_tz = '', $viewer_tz = '') {
31 return Temporal::getAgeByTimezone($dob, $owner_tz, $viewer_tz);
34 function get_dim($y, $m) {
35 return Temporal::getDaysInMonth($y, $m);
38 function get_first_dim($y,$m) {
39 return Temporal::getFirstDayInMonth($y, $m);
42 function cal($y = 0, $m = 0, $links = null, $class = '')
44 return Temporal::getCalendarTable($y, $m, $links, $class);
47 function update_contact_birthdays() {
48 return Contact::updateBirthdays();