function get_shorter_catalog_year_range

6.x misc.inc get_shorter_catalog_year_range($cat_range, $abbr_first = true, $abbr_second = true)
4.x misc.inc get_shorter_catalog_year_range($cat_range, $abbr_first = true, $abbr_second = true)
5.x misc.inc get_shorter_catalog_year_range($cat_range, $abbr_first = true, $abbr_second = true)

This is used usually when being viewed by a mobile device. It will shorten a catalog year range of 2008-2009 to just "08-09" or "2008-09" or even "09-2009".

Parameters

unknown_type $cat_range:

1 call to get_shorter_catalog_year_range()

File

includes/misc.inc, line 1282
This file contains misc functions for FlightPath

Code

function get_shorter_catalog_year_range($cat_range, $abbr_first = true, $abbr_second = true) {

  $temp = explode("-", $cat_range);

  $first = $temp [0];
  $second = $temp [1];

  if ($abbr_first) {
    $first = substr($first, 2, 2);
  }
  if ($abbr_second) {
    $second = substr($second, 2, 2);
  }

  return "$first-$second";
}