From cb5709b81fceba7ef549ab7edc230d1d3e8ae533 Mon Sep 17 00:00:00 2001 From: zaliqarosli Date: Mon, 23 Nov 2020 18:50:36 -0500 Subject: [PATCH] check _date at end only and fix logic" --- php/libraries/NDB_BVL_Instrument_LINST.class.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/libraries/NDB_BVL_Instrument_LINST.class.inc b/php/libraries/NDB_BVL_Instrument_LINST.class.inc index 3886e27e1a9..099556e3c8b 100644 --- a/php/libraries/NDB_BVL_Instrument_LINST.class.inc +++ b/php/libraries/NDB_BVL_Instrument_LINST.class.inc @@ -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( @@ -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,