Formats

play.api.data.format.Formats
object Formats

This object defines several default formatters.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Formats.type

Members list

Value members

Concrete methods

Default formatter for the BigDecimal type.

Default formatter for the BigDecimal type.

Attributes

def dateFormat(pattern: String, timeZone: TimeZone): Formatter[Date]

Formatter for the java.util.Date type.

Formatter for the java.util.Date type.

Value parameters

pattern

a date pattern, as specified in java.time.format.DateTimeFormatter.

timeZone

the java.util.TimeZone to use for parsing and formatting

Attributes

def ignoredFormat[A](value: A): Formatter[A]

Formatter for ignored values.

Formatter for ignored values.

Value parameters

value

As we ignore this parameter in binding/unbinding we have to provide a default value.

Attributes

def localDateFormat(pattern: String): Formatter[LocalDate]

Formatter for the java.time.LocalDate type.

Formatter for the java.time.LocalDate type.

Value parameters

pattern

a date pattern as specified in java.time.format.DateTimeFormatter.

Attributes

def localDateTimeFormat(pattern: String, zoneId: ZoneId): Formatter[LocalDateTime]

Formatter for the java.time.LocalDateTime type.

Formatter for the java.time.LocalDateTime type.

Value parameters

pattern

a date pattern as specified in java.time.format.DateTimeFormatter.

zoneId

the java.time.ZoneId to use for parsing and formatting

Attributes

def localTimeFormat(pattern: String): Formatter[LocalTime]

Formatter for the java.time.LocalTime type.

Formatter for the java.time.LocalTime type.

Value parameters

pattern

a date pattern as specified in java.time.format.DateTimeFormatter.

Attributes

def parsing[T](parse: String => T, errMsg: String, errArgs: Seq[Any])(key: String, data: Map[String, String]): Either[Seq[FormError], T]

Helper for formatters binders

Helper for formatters binders

Value parameters

data

Field data

errArgs

Error to set in case of parsing failure

key

Key name of the field to parse

parse

Function parsing a String value into a T value, throwing an exception in case of failure

Attributes

def sqlDateFormat(pattern: String): Formatter[Date]

Formatter for the java.sql.Date type.

Formatter for the java.sql.Date type.

Value parameters

pattern

a date pattern as specified in java.time.DateTimeFormatter.

Attributes

def sqlTimestampFormat(pattern: String, timeZone: TimeZone): Formatter[Timestamp]

Formatter for the java.sql.Timestamp type.

Formatter for the java.sql.Timestamp type.

Value parameters

pattern

a date pattern as specified in java.time.DateTimeFormatter.

timeZone

the java.util.TimeZone to use for parsing and formatting

Attributes

Implicits

Implicits

Default formatter for the BigDecimal type with no precision

Default formatter for the BigDecimal type with no precision

Attributes

Default formatter for the Boolean type.

Default formatter for the Boolean type.

Attributes

implicit def byteFormat: Formatter[Byte]

Default formatter for the Byte type.

Default formatter for the Byte type.

Attributes

implicit def charFormat: Formatter[Char]

Default formatter for the Char type.

Default formatter for the Char type.

Attributes

implicit val dateFormat: Formatter[Date]

Default formatter for the java.util.Date type with pattern yyyy-MM-dd.

Default formatter for the java.util.Date type with pattern yyyy-MM-dd.

Attributes

implicit def doubleFormat: Formatter[Double]

Default formatter for the Double type.

Default formatter for the Double type.

Attributes

implicit def floatFormat: Formatter[Float]

Default formatter for the Float type.

Default formatter for the Float type.

Attributes

implicit def intFormat: Formatter[Int]

Default formatter for the Int type.

Default formatter for the Int type.

Attributes

implicit val localDateFormat: Formatter[LocalDate]

Default formatter for java.time.LocalDate type with pattern yyyy-MM-dd.

Default formatter for java.time.LocalDate type with pattern yyyy-MM-dd.

Attributes

implicit val localDateTimeFormat: Formatter[LocalDateTime]

Default formatter for java.time.LocalDateTime type with pattern yyyy-MM-dd.

Default formatter for java.time.LocalDateTime type with pattern yyyy-MM-dd.

Attributes

implicit val localTimeFormat: Formatter[LocalTime]

Default formatter for java.time.LocalTime type with pattern HH:mm:ss.

Default formatter for java.time.LocalTime type with pattern HH:mm:ss.

Attributes

implicit def longFormat: Formatter[Long]

Default formatter for the Long type.

Default formatter for the Long type.

Attributes

implicit def shortFormat: Formatter[Short]

Default formatter for the Short type.

Default formatter for the Short type.

Attributes

implicit val sqlDateFormat: Formatter[Date]

Default formatter for java.sql.Date type with pattern yyyy-MM-dd.

Default formatter for java.sql.Date type with pattern yyyy-MM-dd.

Attributes

implicit val sqlTimestampFormat: Formatter[Timestamp]

Default formatter for java.sql.Timestamp type with pattern yyyy-MM-dd HH:mm:ss.

Default formatter for java.sql.Timestamp type with pattern yyyy-MM-dd HH:mm:ss.

Attributes

implicit def stringFormat: Formatter[String]

Default formatter for the String type.

Default formatter for the String type.

Attributes

implicit def uuidFormat: Formatter[UUID]

Default formatter for the java.util.UUID type.

Default formatter for the java.util.UUID type.

Attributes