From 4151963a5c5118061fb1fbf4391e7dffbbc96320 Mon Sep 17 00:00:00 2001 From: "B. Endres" Date: Mon, 25 Nov 2019 08:55:55 +0100 Subject: [PATCH] fixed date parsing for TwingleDonation.Cancel --- api/v3/TwingleDonation/Cancel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v3/TwingleDonation/Cancel.php b/api/v3/TwingleDonation/Cancel.php index 32a4e95..d2bba26 100644 --- a/api/v3/TwingleDonation/Cancel.php +++ b/api/v3/TwingleDonation/Cancel.php @@ -72,7 +72,7 @@ function civicrm_api3_twingle_donation_Cancel($params) { try { // Validate date for parameter "cancelled_at". - if (!DateTime::createFromFormat('Ymd', $params['cancelled_at'])) { + if (!DateTime::createFromFormat('YmdHis', $params['cancelled_at'])) { throw new CiviCRM_API3_Exception( E::ts('Invalid date for parameter "cancelled_at".'), 'invalid_format' @@ -109,7 +109,7 @@ function civicrm_api3_twingle_donation_Cancel($params) { $mandate_id = (int) $mandate['id']; // Mandates can not be terminated in the past. - $end_date = date_create_from_format('Ymd', $params['cancelled_at']); + $end_date = date_create_from_format('YmdHis', $params['cancelled_at']); if ($end_date) { // Mandates can not be terminated in the past: $end_date = date('Ymd', max(