From b1e8e387ff6c83762906263828b391c1e1134087 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Mon, 17 Mar 2025 17:29:07 +0100 Subject: [PATCH] better stringifaction for dateframes --- Models/DateOnlyFrame.cs | 4 ++-- Models/DateTimeFrame.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Models/DateOnlyFrame.cs b/Models/DateOnlyFrame.cs index abde573..4beddf8 100644 --- a/Models/DateOnlyFrame.cs +++ b/Models/DateOnlyFrame.cs @@ -25,8 +25,8 @@ public class DateOnlyFrame public override string ToString() { - var from = (fromDate == DateOnly.MinValue) ? "" : (fromDate.ToShortDateString()); - var to = (toDate == DateOnly.MaxValue) ? "" : (toDate.ToShortDateString()); + var from = (fromDate == DateOnly.MinValue) ? "" : (fromDate.ToString("yyyy-MM-dd")); + var to = (toDate == DateOnly.MaxValue) ? "" : (toDate.ToString("yyyy-MM-dd")); var hyphen = from != "" && to != "" ? "-" : ""; return $"{from}{hyphen}{to}"; } diff --git a/Models/DateTimeFrame.cs b/Models/DateTimeFrame.cs index f8cdb7b..09efea3 100644 --- a/Models/DateTimeFrame.cs +++ b/Models/DateTimeFrame.cs @@ -18,8 +18,8 @@ public class DateTimeFrame public override string ToString() { - var from = (FromDate == DateTime.MinValue) ? "" : ("-" + FromDate.ToShortDateString()); - var to = (ToDate == DateTime.MaxValue) ? "" : ("-" + ToDate.ToShortDateString()); + var from = (FromDate == DateTime.MinValue) ? "" : ("-" + FromDate.ToString("yyyy-MM-dd")); + var to = (ToDate == DateTime.MaxValue) ? "" : ("-" + ToDate.ToString("yyyy-MM-dd")); return $"{from}{to}"; }