You are here

function redhen_format_date in RedHen CRM 7

Consistent date formats for RedHen. Used in all tabular listings.

Parameters

int $timestamp: Timestamp to format.

Return value

string Formatted date.

7 calls to redhen_format_date()
RedhenNote::buildContent in modules/redhen_note/lib/redhen_note.entity.inc
Override buildContent() to add note properties.
redhen_activity_activity_page in modules/redhen_activity/redhen_activity.module
Page callback for a list of activities.
redhen_contact_page in modules/redhen_contact/includes/redhen_contact.pages.inc
Page callback for contact overview page.
redhen_engagements_page in modules/redhen_engagement/redhen_engagement.module
Page callback for showing a contacts engagements.
redhen_note_notes_page in modules/redhen_note/includes/redhen_note.pages.inc

... See full list

File

./redhen.module, line 380
Defines basic functionality common to all parts of the Redhen CRM.

Code

function redhen_format_date($timestamp, $type = 'short') {
  if ($timestamp >= strtotime("today")) {
    $date = t("Today at !date", array(
      '!date' => date('g:ia', $timestamp),
    ));
  }
  elseif ($timestamp >= strtotime("yesterday")) {
    $date = t("Yesterday at !date", array(
      '!date' => date('g:ia', $timestamp),
    ));
  }
  else {
    $date = format_date($timestamp, $type);
  }
  return $date;
}