Class TimeSpanConverter
UXML attribute converter for TimeSpan values, used by TimeField and
TimePicker to express a time of day such as 09:30 or 09:30:00.
Inherited Members
Namespace: Unity.AppUI.Editor
Assembly: Unity.AppUI.Editor.dll
Syntax
public class TimeSpanConverter : UxmlAttributeConverter<TimeSpan>
Methods
FromString(string)
Converts a UXML attribute value into a TimeSpan.
Declaration
public override TimeSpan FromString(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The attribute value to convert. |
Returns
| Type | Description |
|---|---|
| TimeSpan | The converted time span, or zero if the value is empty or cannot be parsed. |
Overrides
ToString(TimeSpan)
Converts a TimeSpan into its UXML attribute representation.
Declaration
public override string ToString(TimeSpan value)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | value | The time span to convert. |
Returns
| Type | Description |
|---|---|
| string | The time span formatted using the invariant culture. |