Class CatchallTimeParser
TimeParser that will allow very loose time to be entered. It will try to parse the first two numbers as hours and the second two numbers as minutes, and will not care about other characters, such as designators, separators or non-time related characters. If the first character is bigger than 2, it will parse only the first character as an hour and will use the second two characters for minutes.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Input.Toolkit.dll
Syntax
public class CatchallTimeParser : TimeParser
Methods
| Improve this Doc View SourceTryParse(String, CultureInfo, out Nullable<DateTime>)
Tries to parse a string to a DateTime.
Declaration
public override bool TryParse(string text, CultureInfo culture, out DateTime? result)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text that should be parsed. |
System.Globalization.CultureInfo | culture | The culture being used. |
System.Nullable<System.DateTime> | result | The parsed DateTime. |
Returns
Type | Description |
---|---|
System.Boolean | True if the parse was successful, false if it was not. |
Overrides
Remarks
The parsing is culture insensitive. A user can type 8p to indicate 20:00:00, or 20.