muety / wakapi

📊 A minimalist, self-hosted WakaTime-compatible backend for coding statistics
https://wakapi.dev
MIT License
2.55k stars 156 forks source link

customizable date format #517

Closed scarf005 closed 1 year ago

scarf005 commented 1 year ago

image

users using YMD date format may have difficulty reading 'Human' date format.

I'm using patch file to work around the issue, but It'd be great to be able to customize date format.

func FormatDateTimeHuman(date time.Time) string {
    return date.Format("2006-01-02 15:04:05 Mon")
}

func FormatDateHuman(date time.Time) string {
    return date.Format("2006-01-02 Mon")
}

https://github.com/muety/wakapi/blob/7f2544f003415eef26eda3c5e0778a8e51814486/helpers/date.go#L35-L42

muety commented 1 year ago

Hi @scarf005, thanks for this feature request! I see how customizable dates would add to better user experience.

However, this touches on the whole big topic of internationalization / i18n, which we decided to be out of scope for Wakapi. Currently, all of Wakapi is in en_US locale (speaking in nerd's terms) as sort of the lowest common denominator. I would love to add in multi-language support, customizable dates, etc. to improve the experience for international users. But, unfortunately, I think it would be way too big of an effort for a project of Wakapi's size and I'd rather prefer to spend our very limited capacity on feature development instead. Wakapi's philosophy is to be minimalist and keep things simple in many different regards.

Sorry to close this issue! Hope you'll still enjoy using Wakapi and keep contributing :-)

scarf005 commented 1 year ago

I don't think this issue is related to internalization at all. What i meant was options to choose such as:

muety commented 1 year ago

Yes, I got that point. But I think it add comparatively low benefit.