Improve date and time header (some tests failing now).
- NEU: Datumsangaben werden in eine Zeile "Laborwerte vom ..." eingebettet.
This commit is contained in:
@ -28,6 +28,33 @@ namespace zaaReloaded2.Formatter
|
||||
/// </summary>
|
||||
public class TimePointFormatter
|
||||
{
|
||||
#region Static methods
|
||||
|
||||
public static string DateHeader(DateTime date)
|
||||
{
|
||||
return FormatHeader(date.ToShortDateString());
|
||||
}
|
||||
|
||||
public static string DateAndTimeHeader(DateTime dateTime)
|
||||
{
|
||||
return FormatHeader(dateTime.ToString());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private static methods
|
||||
|
||||
static string FormatHeader(string text)
|
||||
{
|
||||
return String.Format("{0}Laborwerte vom {1}:{2}",
|
||||
Environment.NewLine,
|
||||
text,
|
||||
Environment.NewLine
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
@ -77,7 +104,7 @@ namespace zaaReloaded2.Formatter
|
||||
/// <returns></returns>
|
||||
public string GetDateHeader()
|
||||
{
|
||||
return FormatHeader(TimeStamp.ToShortDateString());
|
||||
return DateHeader(TimeStamp);
|
||||
}
|
||||
|
||||
|
||||
@ -88,20 +115,7 @@ namespace zaaReloaded2.Formatter
|
||||
/// <returns></returns>
|
||||
public string GetDateAndTimeHeader()
|
||||
{
|
||||
return FormatHeader(TimeStamp.ToString());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private methods
|
||||
|
||||
string FormatHeader(string text)
|
||||
{
|
||||
return String.Format("{0}{1}:{2}",
|
||||
Environment.NewLine,
|
||||
text,
|
||||
Environment.NewLine
|
||||
);
|
||||
return DateAndTimeHeader(TimeStamp);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user