Use ControlUtil.

This commit is contained in:
takezoe
2013-09-21 22:13:15 +09:00
parent 18ca3cbd80
commit e89b2020a3
14 changed files with 272 additions and 278 deletions

View File

@@ -25,10 +25,7 @@ trait Validations {
*/
def date(constraints: Constraint*): SingleValueType[java.util.Date] =
new SingleValueType[java.util.Date]((pattern("\\d{4}-\\d{2}-\\d{2}") +: constraints): _*){
def convert(value: String): java.util.Date = {
val formatter = new java.text.SimpleDateFormat("yyyy-MM-dd")
formatter.parse(value)
}
def convert(value: String): java.util.Date = new java.text.SimpleDateFormat("yyyy-MM-dd").parse(value)
}
}