Added "mysql_date" formatted for MySQL to date output array for easy reference.
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 12 Jan 2018 16:44:12 +0000 (11:44 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 12 Jan 2018 16:44:12 +0000 (11:44 -0500)
lib/GlmDataAbstract/DataAbstract.php

index 5c1ee61..fd8e50b 100644 (file)
@@ -1622,8 +1622,10 @@ $forEdit = true;
         }
 
         // If there was a date stored, then display it, otherwise blank
+        $mysql_date = '';
         if ($d != '') {
             $text_date = date($format, $t);
+            $mysql_date = date('Y/m/d', $t);
         } else {
             $text_date = '';
         }
@@ -1631,7 +1633,8 @@ $forEdit = true;
         // Build return array
         $out = array(
             'date'      => $text_date,
-            'timestamp' => strtotime($text_date)
+            'timestamp' => strtotime($text_date),
+            'mysql_date' => $mysql_date            
         );
 
         // Build picklists for date input
@@ -1737,8 +1740,10 @@ $forEdit = true;
         }
 
         // Use specified format to clean up date
+        $mysql_date = '';
         if ($in > 0) {
             $text_date = date($format, $in);
+            $mysql_date = date('Y/m/d', $in);
         } else {
             $text_date = '';
         }
@@ -1789,6 +1794,7 @@ $forEdit = true;
             'date'      => $text_date,
             'timestamp' => $in,
             'date_list' => $date_list,
+            'mysql_date' => $mysql_date
         );
 
         return $v;
@@ -2098,7 +2104,8 @@ $forEdit = true;
         // Build return array
         $out = array(
                 'datetime'  => $text_datetime,
-                'timestamp' => $t
+                'timestamp' => $t,
+                'mysql_datetime' => $d
         );
 
         // Build picklists for date input
@@ -2268,6 +2275,7 @@ $forEdit = true;
                 'datetime' => $text_date,
                 'timestamp' => $in,
                 'date_list' => $date_list,
+                'mysql_datetime' => $sqlDate
             );
 
             return $v;