Durations and Periods
What's the duration or the period of the event?
Last updated
What's the duration or the period of the event?
Last updated
VisualCard offers a duration parser that allows you to parse a string representation of the duration as specified in the ISO-8601:2004 format. A single function that you can use is GetDurationSpan()
from the vCardCommonTools
class.
Once parsing is done, if the syntax is valid, it returns a tuple of both the DateTimeOffset
that describes a resulting end date added to either a current date or a specified root date, and a TimeSpan
that describes the processed duration.
Periods describe a start date and an end date for a specific time ranged events, and can be described as a precise period of time. You can see its specification from the vCard 2.0 spec . GetTimePeriod()
allows you to parse a period string and convert it to an appropriate TimePeriod
class that has the following properties:
StartDate
: A DateTimeOffset
instance that contains an event start date
EndDate
: A DateTimeOffset
instance that contains an event end date
Duration
: A TimeSpan
instance that contains a computed duration of a time period