localDateParserFmt

info.fingo.spata.text.StringParser.localDateParserFmt
object localDateParserFmt extends FormattedStringParser[LocalDate, DateTimeFormatter]

Parser for date values with support for formats.

Attributes

Graph
Supertypes
trait FormattedStringParser[LocalDate, DateTimeFormatter]
trait StringParser[LocalDate]
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(str: String): LocalDate

Parses string to desired type.

Parses string to desired type.

If parsing fails this function should report error by throwing exception. This is further handled by parse to allow for exception-free, functional code.

Value parameters

str

the input string

Attributes

Returns

parsed value

Throws
RuntimeException

if text cannot be parsed to requested type

Note

This function assumes "standard" string formatting, e.g. point as decimal separator or ISO date and time formats, without any locale support. Use FormattedStringParser if more control over source format is required.

def apply(str: String, fmt: DateTimeFormatter): LocalDate

Parses string to desired type based on provided format.

Parses string to desired type based on provided format.

If parsing fails this function should throw ParseError, possibly wrapping root exception. This is further handled by parse to allow for exception-free, functional code.

Value parameters

fmt

formatter, specific for particular result type, e.g. DateTimeFormatter for dates and times

str

the input string

Attributes

Returns

parsed value

Throws
RuntimeException

if text cannot be parsed to requested type