From 923dad99419f0d8e14adb1d7cf10d35ffc50ea73 Mon Sep 17 00:00:00 2001 From: zacaj Date: Wed, 12 Nov 2025 23:43:36 +0000 Subject: [PATCH] use FormatitemDate for FormatDate --- ui/util/util.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ui/util/util.go b/ui/util/util.go index 2824c34..9891499 100644 --- a/ui/util/util.go +++ b/ui/util/util.go @@ -105,16 +105,18 @@ func FormatDate(t time.Time) string { return "" } - df := dateFormatForLocale(fyne.CurrentDevice().Locale().String()) - switch df { - case DateFormatDMY: - return t.Format("2 Jan 2006") - case DateFormatMDY: - return t.Format("Jan 2 2006") - case DateFormatYMD: - return t.Format("2006 Jan 2") + v := []int{ + t.Local().Year(), + int(t.Local().Month()), + t.Local().Day(), } - return "" + id := mediaprovider.ItemDate{ + Year: &v[0], + Month: &v[1], + Day: &v[2], + } + + return FormatItemDate(id) } func LastPlayedDisplayString(t time.Time) string {