diff --git a/Elwig/App.xaml.cs b/Elwig/App.xaml.cs index 5e77ff4..953f83b 100644 --- a/Elwig/App.xaml.cs +++ b/Elwig/App.xaml.cs @@ -145,7 +145,13 @@ namespace Elwig { var list = new List(); foreach (var s in Config.Scales) { try { - list.Add(Scale.FromConfig(s)); + var scale = Scale.FromConfig(s); + if (scale is ICommandScale cmd) { + try { + await cmd.SetDateAndTime(DateTime.Now); + } catch { } + } + list.Add(scale); } catch (Exception exc) { list.Add(new InvalidScale(s.Id)); if (s.Required) diff --git a/Elwig/Helpers/Weighing/WeighingResult.cs b/Elwig/Helpers/Weighing/WeighingResult.cs index d69afbc..2e3e4ca 100644 --- a/Elwig/Helpers/Weighing/WeighingResult.cs +++ b/Elwig/Helpers/Weighing/WeighingResult.cs @@ -49,7 +49,7 @@ namespace Elwig.Helpers.Weighing { /// <[GrossWeight-TaraWeight=]NetWeight/WeighingId/Date/Time> public override readonly string ToString() { var w = NetWeight != null ? (GrossWeight != null && TareWeight != null ? $"{GrossWeight}-{TareWeight}=" : "") + $"{NetWeight}kg" : ""; - return $"<{w}/{WeighingId}/{Date:yyyy-MM-dd}/{Time:HH:mm}>"; + return $"<{w}/{WeighingId}/{Date:yyyy-MM-dd}/{Time:HH:mm:ss}>"; } public readonly JsonObject ToJson() {