From b68afb8a714fc48e09a6cd1a02959e88e0256c52 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sun, 18 Oct 2015 19:48:39 +0200 Subject: [PATCH] Added comment banners to helpers. --- .../helpers/data_validation_helper.php | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/application/helpers/data_validation_helper.php b/src/application/helpers/data_validation_helper.php index 07bbdb92..acb4e9c2 100644 --- a/src/application/helpers/data_validation_helper.php +++ b/src/application/helpers/data_validation_helper.php @@ -1,18 +1,29 @@ - + * @copyright Copyright (c) 2013 - 2015, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.0.0 + * ---------------------------------------------------------------------------- */ + +/** + * Check if a string date is valid for insertion or update + * to the database. + * + * @param string $datetime The given date. + * @return bool Returns the validation result. + * + * @link http://stackoverflow.com/a/8105844/1718162 [SOURCE] + */ +function validate_mysql_datetime($datetime) { + $dt = DateTime::createFromFormat('Y-m-d H:i:s', $datetime); + return ($dt) ? TRUE : FALSE; +} + +/* End of file data_validation_helper.php */ +/* Location: ./application/helpers/data_validation_helper.php */