Skip to content

Commit

Permalink
check _date at end only and fix logic"
Browse files Browse the repository at this point in the history
  • Loading branch information
zaliqarosli committed Nov 23, 2020
1 parent cb1f676 commit cb5709b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/libraries/NDB_BVL_Instrument_LINST.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
// Set date format
$dateFormat = isset($pieces[5]) ? trim($pieces[5]) : "";

if (isset($dateFormat) && $dateFormat != "") {
if (isset($dateFormat) && $dateFormat != "" && $dateFormat !== "Date") {
if ($dateFormat === 'MonthYear') {
// Shows date without day of month
$this->addMonthYear(
Expand All @@ -595,7 +595,7 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
} else {
// addDateElement appends '_date' to the field name so
// remove it first here
if (strpos($pieces[1], "_date") !== false) {
if (substr($pieces[1], -5) == "_date") {
$pieces[1] = substr(
$pieces[1],
0,
Expand Down

0 comments on commit cb5709b

Please # to comment.