Class FromToTDt<T>
- Namespace
- SunamoDateTime._public
- Assembly
- SunamoDateTime.dll
Generic time range class with parsing and formatting capabilities. EN: Contains methods that were earlier in FromToT class. CZ: Obsahuje metody které byly dříve ve třídě FromToT.
public class FromToTDt<T> : FromToTSHDt<T> where T : struct
Type Parameters
TThe type of the From and To values (must be a struct)
- Inheritance
-
FromToTSHDt<T>FromToTDt<T>
- Derived
- Inherited Members
- Extension Methods
Constructors
FromToTDt()
Initializes a new instance of the FromToTDt class. EN: Sets UseType to None for int type. CZ: Nastaví UseType na None pro typ int.
public FromToTDt()
FromToTDt(T, T, FromToUseDateTime)
Initializes a time range with specified From and To values. EN: Creates a time range with the given start and end values. CZ: Vytvoří časový rozsah se zadanými počáteční a koncovou hodnotou.
public FromToTDt(T from, T to, FromToUseDateTime useType = FromToUseDateTime.DateTime)
Parameters
fromTThe start value of the time range
toTThe end value of the time range
useTypeFromToUseDateTimeThe type of time range usage (DateTime, Unix, None, etc.)
Methods
IsFilledWithData()
Checks if the time range has been filled with data. EN: Returns true if To value is valid (>= 0 and != 0). CZ: Vrací true pokud je hodnota To platná (>= 0 a != 0).
public bool IsFilledWithData()
Returns
- bool
True if data is filled, false otherwise
Parse(string)
Parses a time range string and populates From and To values. EN: After calling this method, IsFilledWithData can be used to verify the data. CZ: Po zavolání této metody lze použít IsFilledWithData k ověření dat.
public void Parse(string text)
Parameters
textstringTime range string (e.g. "12:30-14:00" or "12-14")
ToString(LangsDt)
Converts the time range to a string representation. EN: Returns formatted time range based on UseType. CZ: Vrací formátovaný časový rozsah podle UseType.
public string ToString(LangsDt lang)
Parameters
langLangsDtLanguage for formatting
Returns
- string
String representation of the time range
ToStringDateTime(LangsDt)
Converts the time range to DateTime string representation. EN: Virtual method to be overridden by derived classes. CZ: Virtuální metoda k přepsání v odvozených třídách.
protected virtual string ToStringDateTime(LangsDt lang)
Parameters
langLangsDtLanguage for formatting
Returns
- string
DateTime string representation