Fix Waagen

This commit is contained in:
2023-08-11 18:46:58 +02:00
parent c65ffaf161
commit 041e674af9
3 changed files with 87 additions and 25 deletions

View File

@ -1,3 +1,5 @@
using System;
namespace Elwig.Helpers.Weighing {
/// <summary>
/// Result of a weighing process on an industrial scale
@ -16,17 +18,17 @@ namespace Elwig.Helpers.Weighing {
/// <summary>
/// Date string provided by the scale
/// </summary>
public string? Date = null;
public DateOnly? Date = null;
/// <summary>
/// Time string provided by the scale
/// </summary>
public string? Time = null;
public TimeOnly? Time = null;
/// <returns>&lt;Weight/WeighingId/Date/Time&gt;</returns>
override public string ToString() {
var w = Weight != null ? $"{Weight}kg" : "";
return $"<{w}/{WeighingId}/{Date}/{Time}>";
return $"<{w}/{WeighingId}/{Date:yyyy-MM-dd}/{Time:HH:mm}>";
}
}
}