From 516d60c4db69e863a9cd7529c3c931db953f5f70 Mon Sep 17 00:00:00 2001 From: Matt Melling Date: Fri, 23 Dec 2022 12:55:58 +0000 Subject: [PATCH] fix date validation for adif export --- application/models/Adif_data.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Adif_data.php b/application/models/Adif_data.php index 898575d6..323aa7fb 100644 --- a/application/models/Adif_data.php +++ b/application/models/Adif_data.php @@ -82,12 +82,12 @@ class adif_data extends CI_Model { $this->db->where($this->config->item('table_name').'.station_id', $station_id); // If date is set, we format the date and add it to the where-statement - if ($from != 0) { + if ($from) { $from = DateTime::createFromFormat('d/m/Y', $from); $from = $from->format('Y-m-d'); $this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) >= '".$from."'"); } - if ($to != 0) { + if ($to) { $to = DateTime::createFromFormat('d/m/Y', $to); $to = $to->format('Y-m-d'); $this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) <= '".$to."'");