Code Duplication    Length = 12-12 lines in 2 locations

model/fieldtypes/Date.php 1 location

@@ 400-411 (lines=12) @@
397
		}
398
	}
399
400
	public function scaffoldFormField($title = null, $params = null) {
401
		$field = DateField::create($this->name, $title);
402
403
		// Show formatting hints for better usability
404
		$field->setDescription(sprintf(
405
			_t('FormField.Example', 'e.g. %s', 'Example format'),
406
			Convert::raw2xml(Zend_Date::now()->toString($field->getConfig('dateformat')))
407
		));
408
		$field->setAttribute('placeholder', $field->getConfig('dateformat'));
409
410
		return $field;
411
	}
412
}
413

model/fieldtypes/Time.php 1 location

@@ 73-84 (lines=12) @@
70
		DB::require_field($this->tableName, $this->name, $values);
71
	}
72
73
	public function scaffoldFormField($title = null, $params = null) {
74
		$field = TimeField::create($this->name, $title);
75
76
		// Show formatting hints for better usability
77
		$field->setDescription(sprintf(
78
			_t('FormField.Example', 'e.g. %s', 'Example format'),
79
			Convert::raw2xml(Zend_Date::now()->toString($field->getConfig('timeformat')))
80
		));
81
		$field->setAttribute('placeholder', $field->getConfig('timeformat'));
82
83
		return $field;
84
	}
85
86
}
87