From: <dj...@us...> - 2012-02-13 01:09:42
|
Revision: 8943 http://xoops.svn.sourceforge.net/xoops/?rev=8943&view=rev Author: djculex Date: 2012-02-13 01:09:36 +0000 (Mon, 13 Feb 2012) Log Message: ----------- Bugfix: Removed php 5.30 function to convert dateformat and replaced with simpler function Modified Paths: -------------- XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt XoopsModules/smallworld/trunk/smallworld/include/functions.php Modified: XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt =================================================================== --- XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2012-02-12 23:10:22 UTC (rev 8942) +++ XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2012-02-13 01:09:36 UTC (rev 8943) @@ -18,6 +18,9 @@ 12. Fevruary 2012 - Bugfix: Keep imagegallery in colorbox even if imageData.index is null +13. February +- Bugfix: Removed php 5.30 function to convert dateformat and replaced with simpler function + ------------------------------ Changelog v.1.10 RC ------------------------------ Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-02-12 23:10:22 UTC (rev 8942) +++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-02-13 01:09:36 UTC (rev 8943) @@ -595,22 +595,31 @@ return $res; } -// Return new date format US for MySql -// Require php>5.2 using DateTime class -function Smallworld_euroToUsDate ($stringDate) { +/* + * Return date format (YYYY-MM-DD) for MySql + * @param date $stringDate + * $returns date +*/ +function Smallworld_euroToUsDate($stringDate) { if ($stringDate != 0 || $stringDate != '') { - $date = DateTime::createFromFormat('d-m-Y', $stringDate); - return $date->format("Y-m-d"); + $theData = split("-", trim($stringDate)); + $ret = $theData[2] . "-" . $theData[1] . "-" . $theData[0]; + return $ret; } else { return "1900-01-01"; } } -// Return new date format EU For display -function Smallworld_UsToEuroDate ($stringDate) { +/* + * Return date format (DD-MM-YYYY) for display + * @param date $stringDate + * $returns date +*/ +function Smallworld_UsToEuroDate($stringDate) { if ($stringDate != 0 || $stringDate != '') { - $date = DateTime::createFromFormat('Y-m-d', $stringDate); - return $date->format("d-m-Y"); + $theData = split("-", trim($stringDate)); + $ret = $theData[2] . "-" . $theData[1] . "-" . $theData[0]; + return $ret; } else { return "01-01-1900"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |