Class YandexTrackerDuration
- Namespace
- YandexTracker
- Assembly
- YandexTracker.dll
Tracker durations (original estimate, remaining estimate, time spent) are ISO 8601 strings such as
P1W2DT3H30M, counted in working time: a week is 5 working days and a day is 8 hours. This helper converts
them to hours and back by the same rules.
public static class YandexTrackerDuration
- Inheritance
-
YandexTrackerDuration
- Inherited Members
Methods
FromHours(decimal, decimal)
Converts working hours to a Tracker duration: whole days as D, the rest as hours and minutes.
public static string FromHours(decimal hours, decimal hoursPerDay = 8)
Parameters
hoursdecimalThe hours; must not be negative.
hoursPerDaydecimalWorking hours in a day; 8 by default.
Returns
- string
A duration such as
P1DT4H30M; zero isPT0H.
Exceptions
- ArgumentOutOfRangeException
hoursis negative.
ToHours(string?, decimal, decimal)
Converts a Tracker duration to working hours.
public static decimal? ToHours(string? value, decimal hoursPerDay = 8, decimal daysPerWeek = 5)
Parameters
valuestringA duration such as
P1DT4H.hoursPerDaydecimalWorking hours in a day; 8 by default.
daysPerWeekdecimalWorking days in a week; 5 by default.