You are here

function PARSEMONTH::init in Bibliography Module 6

Same name and namespace in other branches
  1. 5 bibtexParse/PARSEMONTH.php \PARSEMONTH::init()
  2. 6.2 modules/bibtexParse/PARSEMONTH.php \PARSEMONTH::init()
  3. 7.3 plugins/biblio_style/bibtex/PARSEMONTH.php \PARSEMONTH::init()
  4. 7 modules/bibtexParse/PARSEMONTH.php \PARSEMONTH::init()
  5. 7.2 modules/bibtexParse/PARSEMONTH.php \PARSEMONTH::init()

File

bibtexParse/PARSEMONTH.php, line 32

Class

PARSEMONTH

Code

function init($monthField) {
  $startMonth = $this->startDay = $endMonth = $this->endDay = FALSE;
  $date = split("#", $monthField);
  foreach ($date as $field) {
    $field = ucfirst(strtolower(trim($field)));
    if ($month = array_search($field, $this
      ->monthToLongName())) {
      if (!$startMonth) {
        $startMonth = $month;
      }
      else {
        $endMonth = $month;
      }
      continue;
    }
    else {
      if ($month = array_search($field, $this
        ->monthToShortName())) {
        if (!$startMonth) {
          $startMonth = $month;
        }
        else {
          $endMonth = $month;
        }
        continue;
      }
    }
    $this
      ->parseDay($field);
  }
  if ($this->endDay && !$endMonth) {
    $endMonth = $startMonth;
  }
  return array(
    $startMonth,
    $this->startDay,
    $endMonth,
    $this->endDay,
  );
}