better stringifaction for dateframes

This commit is contained in:
honzapatCZ 2025-03-17 17:29:07 +01:00
parent 51f66b2b2c
commit b1e8e387ff
2 changed files with 4 additions and 4 deletions

View File

@ -25,8 +25,8 @@ public class DateOnlyFrame
public override string ToString() public override string ToString()
{ {
var from = (fromDate == DateOnly.MinValue) ? "" : (fromDate.ToShortDateString()); var from = (fromDate == DateOnly.MinValue) ? "" : (fromDate.ToString("yyyy-MM-dd"));
var to = (toDate == DateOnly.MaxValue) ? "" : (toDate.ToShortDateString()); var to = (toDate == DateOnly.MaxValue) ? "" : (toDate.ToString("yyyy-MM-dd"));
var hyphen = from != "" && to != "" ? "-" : ""; var hyphen = from != "" && to != "" ? "-" : "";
return $"{from}{hyphen}{to}"; return $"{from}{hyphen}{to}";
} }

View File

@ -18,8 +18,8 @@ public class DateTimeFrame
public override string ToString() public override string ToString()
{ {
var from = (FromDate == DateTime.MinValue) ? "" : ("-" + FromDate.ToShortDateString()); var from = (FromDate == DateTime.MinValue) ? "" : ("-" + FromDate.ToString("yyyy-MM-dd"));
var to = (ToDate == DateTime.MaxValue) ? "" : ("-" + ToDate.ToShortDateString()); var to = (ToDate == DateTime.MaxValue) ? "" : ("-" + ToDate.ToString("yyyy-MM-dd"));
return $"{from}{to}"; return $"{from}{to}";
} }