fun String.toYearMonth(): YearMonthfun String.toYearMonth(): YearMonthfun String.toYearMonth(): YearMonthfun String.toYearMonth(): YearMonth
Convert a string to a YearMonth.
The string is assumed to be an ISO-8601 year-month in extended format. For example, 2010-05 or 1960-12. The
output of YearMonth.toString can be safely parsed using this method.
DateTimeParseException - if parsing fails
DateTimeException - if the parsed time is invalid
fun String.toYearMonth(parser: DateTimeParser): YearMonthfun String.toYearMonth(parser: DateTimeParser): YearMonthfun String.toYearMonth(parser: DateTimeParser): YearMonthfun String.toYearMonth(parser: DateTimeParser): YearMonth
Convert a string to a YearMonth using a specific parser.
The parser must be capable of supplying DateTimeField.YEAR and DateTimeField.MONTH_OF_YEAR.
A set of predefined parsers can be found in DateTimeParsers.