The Red Matrix
 All Classes Namespaces Files Functions Variables Pages
datetime.php File Reference

Functions

 timezone_cmp ($a, $b)
 
 get_timezones ()
 
 datetime_convert ($from= 'UTC', $to= 'UTC', $s= 'now', $fmt="Y-m-d H:i:s")
 
 dob ($dob)
 
 datesel ($format, $min, $max, $default, $id= 'datepicker')
 
 timesel ($format, $h, $m, $id='timepicker')
 
 datetimesel ($format, $min, $max, $default, $id= 'datetimepicker', $pickdate=true, $picktime=true, $minfrom= '', $maxfrom= '', $required=false)
 
 relative_date ($posted_date, $format=null)
 
 age ($dob, $owner_tz= '', $viewer_tz= '')
 
 get_dim ($y, $m)
 
 get_first_dim ($y, $m)
 
 cal ($y=0, $m=0, $links=false, $class='')
 
 z_birthday ($dob, $tz, $format="Y-m-d H:i:s")
 
 update_birthdays ()
 

Function Documentation

age (   $dob,
  $owner_tz = '',
  $viewer_tz = '' 
)
cal (   $y = 0,
  $m = 0,
  $links = false,
  $class = '' 
)

Referenced by events_content().

datesel (   $format,
  $min,
  $max,
  $default,
  $id = 'datepicker' 
)

returns a date selector

Parameters
$formatformat string, e.g. 'ymd' or 'mdy'. Not currently supported
$minunix timestamp of minimum date
$maxunix timestap of maximum date
$defaultunix timestamp of default date
$idid and name of datetimepicker (defaults to "datetimepicker")
datetime_convert (   $from = 'UTC',
  $to = 'UTC',
  $s = 'now',
  $fmt = "Y-m-d H:i:s" 
)

Referenced by abook_toggle_flag(), advanced_profile(), age(), api_account_rate_limit_status(), api_date(), api_rss_extra(), atom_entry(), attach_delete(), attach_mkdir(), attach_store(), authenticate_success(), build_sync_packet(), cal(), channel_content(), channel_remove(), chat_message(), chatroom_create(), chatroom_enter(), chatsvc_content(), chatsvc_post(), Cache\clear(), comments_are_now_closed(), connedit_post(), consume_feed(), conversation(), create_account(), create_identity(), RedMatrix\RedDAV\RedDirectory\createFile(), cronhooks_run(), delete_item_lowlevel(), deliver_run(), diaspora_asphoto(), diaspora_comment(), diaspora_conversation(), diaspora_message(), diaspora_post(), diaspora_profile(), diaspora_request(), diaspora_reshare(), diaspora_send_images(), diaspora_send_mail(), diaspora_send_status(), diaspora_transmit(), directory_run(), dirsearch_content(), discover_by_url(), discover_by_webbie(), dlogger(), dob(), editpost_content(), ev_compare(), event_store_event(), events_content(), events_post(), externals_run(), first_post_date(), fix_system_urls(), format_event_diaspora(), format_event_html(), format_event_ical(), fsuggest_post(), RedMatrix\RedDAV\RedBrowser\generateDirectoryIndex(), get_atom_elements(), get_birthdays(), get_events(), get_feed_for(), get_first_dim(), get_item_elements(), get_mail_elements(), get_profile_elements(), get_public_feed(), Item\get_template_data(), RedMatrix\RedDAV\RedFile\getLastModified(), RedMatrix\RedDAV\RedDirectory\getLastModified(), home_content(), impel_init(), import_author_rss(), import_author_unknown(), import_directory_profile(), import_post(), import_site(), import_xchan(), invite_post(), item_post(), item_store(), item_store_update(), items_fetch(), list_post_dates(), log_failed_login(), logger(), magic_init(), mail_content(), mail_post(), mail_store(), manage_content(), message_content(), network_content(), new_contact(), notification(), notifier_run(), onepoll_run(), openid_content(), p_init(), pagelist_widget(), photo_upload(), photos_post(), ping_init(), poco_load(), poller_run(), post_post(), posted_dates(), prate_post(), process_rating_delivery(), profile_photo_post(), profiles_content(), profiles_post(), prune_hub_reinstalls(), pubsubhubbub_init(), RedMatrix\RedDAV\RedFile\put(), dba_mysql\q(), dba_mysqli\q(), dba_postgres\q(), queue_run(), rate_post(), ratenotif_run(), relative_date(), removeaccount_post(), removeme_post(), photo_driver\save(), send_message(), send_reg_approval_email(), Cache\set(), settings_post(), photo_driver\store(), sync_directories(), sync_locations(), tag_deliver(), update_birthdays(), update_directory_entry(), update_modtime(), update_queue_time(), verify_email_address(), webpages_content(), widget_archive(), xchan_store(), z_birthday(), zot_feed(), zot_process_message_request(), zot_process_response(), zot_refresh(), and zotfeed_init().

datetimesel (   $format,
  $min,
  $max,
  $default,
  $id = 'datetimepicker',
  $pickdate = true,
  $picktime = true,
  $minfrom = '',
  $maxfrom = '',
  $required = false 
)

returns a datetime selector

Parameters
$formatformat string, e.g. 'ymd' or 'mdy'. Not currently supported
$minunix timestamp of minimum date
$maxunix timestap of maximum date
$defaultunix timestamp of default date
$idid and name of datetimepicker (defaults to "datetimepicker")
$pickdatetrue to show date picker (default)
$picktimetrue to show time picker (default)
$minfromset minimum date from picker with id $minfrom (none by default)
$maxfromset maximum date from picker with id $maxfrom (none by default)

Referenced by datesel(), events_content(), and timesel().

dob (   $dob)

Referenced by profiles_content().

get_dim (   $y,
  $m 
)
get_first_dim (   $y,
  $m 
)

Referenced by cal().

get_timezones ( )

Referenced by setup_content().

timesel (   $format,
  $h,
  $m,
  $id = 'timepicker' 
)

returns a time selector

Parameters
$formatformat string, e.g. 'ymd' or 'mdy'. Not currently supported
$halready selected hour
$malready selected minute
$idid and name of datetimepicker (defaults to "timepicker")
timezone_cmp (   $a,
  $b 
)
update_birthdays ( )

Create a birthday event for any connections with a birthday in the next 1-2 weeks. Update the year so that we don't create another event until next year.

Referenced by poller_run().

z_birthday (   $dob,
  $tz,
  $format = "Y-m-d H:i:s" 
)

Return the next birthday, converted from the owner's timezone to UTC. This makes it globally portable. If the provided birthday lacks a month and or day, return an empty string. A missing year is acceptable.

Referenced by zfinger_init().