mirror of
https://github.com/dg/dibi.git
synced 2025-02-24 19:02:36 +01:00
changed empty-date detection
This commit is contained in:
parent
5e7774404b
commit
8586eb8e29
@ -624,7 +624,7 @@ class DibiResult extends DibiObject implements IDataSource
|
|||||||
|
|
||||||
case dibi::DATE:
|
case dibi::DATE:
|
||||||
case dibi::DATETIME:
|
case dibi::DATETIME:
|
||||||
if ($value == NULL) { // intentionally ==
|
if ((int) $value === 0) { // '', NULL, FALSE, '0000-00-00', ...
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
} elseif ($format === NULL) { // return timestamp (default)
|
} elseif ($format === NULL) { // return timestamp (default)
|
||||||
|
@ -48,7 +48,7 @@ class DibiRow extends ArrayObject
|
|||||||
public function asDate($key, $format = NULL)
|
public function asDate($key, $format = NULL)
|
||||||
{
|
{
|
||||||
$time = $this[$key];
|
$time = $this[$key];
|
||||||
if ($time == NULL) { // intentionally ==
|
if ((int) $time === 0) { // '', NULL, FALSE, '0000-00-00', ...
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
} elseif ($format === NULL) { // return timestamp (default)
|
} elseif ($format === NULL) { // return timestamp (default)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user