public class ChronicFormatter extends SimpleDateFormat
DateFormat.Field
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
Constructor and Description |
---|
ChronicFormatter(String pattern)
Constructs a new ChronicFormatter.
|
ChronicFormatter(String pattern,
Options options)
Constructs a new ChronicFormatter.
|
ChronicFormatter(String pattern,
Options options,
boolean guessingEarly)
Constructs a new ChronicFormatter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isGuessingEarly()
Returns whether or not this parser guesses the beginning of a span if a date parses as a span.
|
Options |
options()
Returns the options used by this formatter.
|
NSTimestamp |
parseObject(String text) |
void |
setGuessingEarly(boolean guessingEarly)
Sets whether or not this parser guesses the beginning of a span if a date parses as a span.
|
void |
setOptions(Options options)
Sets the options used by this formatter.
|
applyLocalizedPattern, applyPattern, clone, equals, format, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, parse, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPattern
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
public ChronicFormatter(String pattern)
pattern
- the SimpleDateFormat pattern to parsepublic ChronicFormatter(String pattern, Options options)
pattern
- the SimpleDateFormat pattern to parseoptions
- the chronic options to parse withpublic ChronicFormatter(String pattern, Options options, boolean guessingEarly)
pattern
- the SimpleDateFormat pattern to parseoptions
- the chronic options to parse withguessingEarly
- if true, guess the start of a span if the parsed date returns a spanpublic Options options()
public void setOptions(Options options)
options
- the options used by this formatterpublic boolean isGuessingEarly()
public void setGuessingEarly(boolean guessingEarly)
guessingEarly
- whether or not this parser guesses the beginning of a spanpublic NSTimestamp parseObject(String text) throws ParseException
parseObject
in class Format
ParseException
Copyright © 2002 – 2024 Project Wonder.