Merge pull request #1866 from mattmelling/adif-export-1863

Fix date validation on ADIF export
这个提交包含在:
Andreas Kristiansen 2022-12-24 10:15:20 +01:00 提交者 GitHub
当前提交 3c4f50d7d8
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -82,12 +82,12 @@ class adif_data extends CI_Model {
$this->db->where($this->config->item('table_name').'.station_id', $station_id); $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 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 = DateTime::createFromFormat('d/m/Y', $from);
$from = $from->format('Y-m-d'); $from = $from->format('Y-m-d');
$this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) >= '".$from."'"); $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 = DateTime::createFromFormat('d/m/Y', $to);
$to = $to->format('Y-m-d'); $to = $to->format('Y-m-d');
$this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) <= '".$to."'"); $this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) <= '".$to."'");