Formatting fixed

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77099 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2009-05-18 21:24:33 +00:00
parent b0a56e7d37
commit a4cf64f105

View File

@ -13,9 +13,9 @@
*/
class SSDatetime extends Date {
function setValue($value) {
// Default to NZ date format - strtotime expects a US date
if(ereg('^([0-9]+)/([0-9]+)/([0-9]+)$', $value, $parts))
$value = "$parts[2]/$parts[1]/$parts[3]";
// Default to NZ date format - strtotime expects a US date
if(ereg('^([0-9]+)/([0-9]+)/([0-9]+)$', $value, $parts))
$value = "$parts[2]/$parts[1]/$parts[3]";
if($value) $this->value = date('Y-m-d H:i:s', strtotime($value));
else $value = null;