You are here

function _commerce_pricelist_display_date in Commerce Pricelist 7

Format a date for display, return empty string for default date values.

Parameters

$value:

bool $format:

Return value

mixed|string

2 calls to _commerce_pricelist_display_date()
commerce_pricelist_item_form in includes/commerce_pricelist.admin.inc
Form function to create an commerce_pricelist_list entity.
commerce_pricelist_item_list_entities in includes/commerce_pricelist.admin.inc
Returns a render array with all commerce_pricelist_list entities.

File

./commerce_pricelist.module, line 665
Implements the basic functionality required for price lists

Code

function _commerce_pricelist_display_date($value, $format = FALSE) {
  if ($value < COMMERCE_PRICELIST_UNIX_TIME_APOCALYPSE && $value > 0 && is_numeric($value)) {
    return $format ? format_date($value, 'custom', $format) : format_date($value, 'short');
  }
  return '';
}