Home

# Class goog.i18n.DateTimeParse

Construct a DateTimeParse based on current locale.

Instance Method Summary
| `applyPattern_(string pattern)` Apply a pattern to this Parser. The pattern string will be parsed and saved in "compiled" form. Note: this method is somewhat similar to the pattern parsing methold in datetimeformat. If you see something wrong here, you might want to check the other.
| `applyStandardPattern_(number formatType)` Apply a predefined pattern to this Parser.
| `getNextCharCount_(string pattern, number start) ⇒ number` Calculate character repeat count in pattern.
| `internalParse_(string text, ?goog.date.DateLike date, number start, boolean validation) ⇒ number` Parse the given string and fill info into date object.
| `isNumericField_(?Object part) ⇒ boolean` Check if the pattern part is a numeric field.

`markAbutStart_()`

Identify the start of an abutting numeric fields' run. Taking pattern "HHmmss" as an example. It will try to parse 2/2/2 characters of the input text, then if that fails, 1/2/2. We only adjust the width of the leftmost field; the others remain fixed. This allows "123456" => 12:34:56, but "12345" => 1:23:45. Likewise, for the pattern "yyyyMMdd" we try 4/2/2, 3/2/2, 2/2/2, and finally 1/2/2. The first field of connected numeric fields will be marked as abutStart, its width can be reduced to accomodate others.

| `matchString_(string text, ?Array.<number> pos, ?Array.<string> data) ⇒ number` Attempt to match the text at a given position against an array of strings. Since multiple strings in the array may match (for example, if the array contains "a", "ab", and "abc", all will match the input string "abcd") the longest match is returned.
| `parse(string text, ?goog.date.DateLike date, number= opt_start) ⇒ number` Parse the given string and fill info into date object. This version does not validate the input.
| `parseInt_(string text, ?Array.<number> pos) ⇒ number` Parse a integer string and return integer value.
| `parseTimeZoneOffset_(string text, ?Array.<number> pos, ?goog.i18n.DateTimeParse.MyDate_ cal) ⇒ boolean` Parse time zone offset.
| `skipSpace_(string text, ?Array.<number> pos)` Skip space in the string.
| `strictParse(string text, ?goog.date.DateLike date, number= opt_start) ⇒ number` Parse the given string and fill info into date object. This version will validate the input and make sure it is a validate date/time.
| `subParseDayOfWeek_(string text, ?Array.<number> pos, ?goog.i18n.DateTimeParse.MyDate_ cal) ⇒ boolean` Parse Day of week field.
| `subParseFractionalSeconds_(number value, ?Array.<number> pos, number start, ?goog.i18n.DateTimeParse.MyDate_ cal) ⇒ boolean` Parse fractional seconds field.
| `subParseMonth_(string text, ?Array.<number> pos, ?goog.i18n.DateTimeParse.MyDate_ cal, number value) ⇒ boolean` Parse Month field.
| `subParseQuarter_(string text, ?Array.<number> pos, ?goog.i18n.DateTimeParse.MyDate_ cal, number value) ⇒ boolean` Parse Quarter field.
| `subParseYear_(string text, ?Array.<number> pos, number start, number value, ?Object part, ?goog.i18n.DateTimeParse.MyDate_ cal) ⇒ boolean` Parse year field. Year field is special because 1) two digit year need to be resolved. 2) we allow year to take a sign. 3) year field participate in abut processing.
| `subParse_(string text, ?Array.<number> pos, ?Object part, number digitCount, ?goog.i18n.DateTimeParse.MyDate_ cal) ⇒ boolean` Protected method that converts one field of the input string into a numeric field value.
| `subparseTimeZoneInGMT_(string text, ?Array.<number> pos, ?goog.i18n.DateTimeParse.MyDate_ cal) ⇒ boolean` Parse GMT type timezone.

Static Method Summary
| `MyDate_()` This class hold the intermediate parsing result. After all fields are consumed, final result will be resolved from this class.