[surforce-library commit] r54 - Agrega validación: si la fecha por parámetros está vacía, no hace nada

1 view
Skip to first unread message

codesite...@google.com

unread,
Jun 16, 2009, 11:19:29 PM6/16/09
to surforce...@googlegroups.com
Author: enriqueplace
Date: Tue Jun 16 20:10:59 2009
New Revision: 54

Modified:
trunk/library/Zsurforce/View/Helper/DateFormat.php

Log:
Agrega validación: si la fecha por parámetros está vacía, no hace nada

Modified: trunk/library/Zsurforce/View/Helper/DateFormat.php
==============================================================================
--- trunk/library/Zsurforce/View/Helper/DateFormat.php (original)
+++ trunk/library/Zsurforce/View/Helper/DateFormat.php Tue Jun 16 20:10:59
2009
@@ -16,10 +16,12 @@
*/
public function dateFormat ($date)
{
- $fecha = explode(" ", $date);
- // $hora = $fecha[1];
- $f = explode("-", $fecha[0]);
- $xhtml = $f['2'] . "/" . $f['1'] . "/" . $f['0'];
- return $xhtml;
+ if($date != ''){
+ $fecha = explode(" ", $date);
+ // $hora = $fecha[1];
+ $f = explode("-", $fecha[0]);
+ $xhtml = $f['2'] . "/" . $f['1'] . "/" . $f['0'];
+ return $xhtml;
+ }
}
}
Reply all
Reply to author
Forward
0 new messages