Code Duplication    Length = 3-3 lines in 2 locations

model/fieldtypes/Date.php 1 location

@@ 43-45 (lines=3) @@
40
		}
41
42
		// Default to NZ date format - strtotime expects a US date
43
		if(preg_match('#^([0-9]+)/([0-9]+)/([0-9]+)$#', $value, $parts)) {
44
			$value = "$parts[2]/$parts[1]/$parts[3]";
45
		}
46
47
		if(is_numeric($value)) {
48
			$this->value = date('Y-m-d', $value);

model/fieldtypes/Datetime.php 1 location

@@ 37-39 (lines=3) @@
34
		}
35
36
		// Default to NZ date format - strtotime expects a US date
37
		if(preg_match('#^([0-9]+)/([0-9]+)/([0-9]+)$#', $value, $parts)) {
38
			$value = "$parts[2]/$parts[1]/$parts[3]";
39
		}
40
41
		if(is_numeric($value)) {
42
			$this->value = date('Y-m-d H:i:s', $value);