function PARSEMONTH::init in Bibliography Module 5
Same name and namespace in other branches
- 6.2 modules/bibtexParse/PARSEMONTH.php \PARSEMONTH::init()
- 6 bibtexParse/PARSEMONTH.php \PARSEMONTH::init()
- 7.3 plugins/biblio_style/bibtex/PARSEMONTH.php \PARSEMONTH::init()
- 7 modules/bibtexParse/PARSEMONTH.php \PARSEMONTH::init()
- 7.2 modules/bibtexParse/PARSEMONTH.php \PARSEMONTH::init()
File
- bibtexParse/
PARSEMONTH.php, line 32
Class
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,
);
}