Beispiel #1
0
 /// <summary>
 /// Trim a DateTime to the smallest whole TimeSpan that fits within a 24 hour period.
 /// </summary>
 /// <param name="input">The time to trim</param>
 /// <param name="interval">The smallest timespan per day to allow</param>
 /// <returns></returns>
 public static DateTimeOffset TrimTo(this DateTimeOffset input, TimeSpan interval)
 {
     return(DDRIT.TrimTo(input, interval));
 }
Beispiel #2
0
 /// <summary>
 /// Trim a TimeSpan to the smallest whole TimeSpan that fits within a 24 hour period.
 /// </summary>
 /// <param name="input">The time to trim</param>
 /// <param name="interval">The smallest timespan per day to allow</param>
 /// <returns></returns>
 public static TimeSpan TrimTo(this TimeSpan input, TimeSpan interval)
 {
     return(DDRIT.TrimTo(input, interval));
 }
Beispiel #3
0
 /// <summary>
 /// Trim markup to the longest string of whole words, under a particular length, and append an elipsis if there is truncated content.
 /// If the length is shorter than the first whole word, then returns the first whole word, and appends an elipsis if there is truncated content.
 /// </summary>
 /// <param name="input">The content to trim</param>
 /// <param name="maxLength">The maximum length of the returned content</param>
 /// <param name="stripTags">(true)Remove HTML tags before trimming</param>
 /// <returns></returns>
 public static String TrimTo(this String input, Int32 maxLength, Boolean stripTags = true)
 {
     return(DDRIT.TrimTo(input, maxLength, stripTags));
 }