jeffvli / feishin

A modern self-hosted music player.
https://feishin.vercel.app
GNU General Public License v3.0
2.46k stars 103 forks source link

[bugfix]: switch to UTC for release dates #743

Closed iiPythonx closed 2 weeks ago

iiPythonx commented 2 weeks ago

This commit switches DayJS to use UTC rather then local time when processing absolute dates, this fixes a bug where albums would show as releasing a day before they really did.

Some quick tests I did:

If you see anything wrong let me know, but I've tested every file that uses this function and they all seem to work correctly.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
feishin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 1:35am
iiPythonx commented 2 weeks ago

In that case, would you prefer the default being left as local and then adding a UTC version? Edit: did that instead.

Optekah commented 1 week ago

Thank you for fixing this! I have entries tagged 1983-09 showing up as Aug 31, 1983

When this is implemented, will that 1983-09 release now display as Sept, 1983 or Sept 1, 1983 on an album page?

kgarner7 commented 1 week ago

Thank you for fixing this! I have entries tagged 1983-09 showing up as Aug 31, 1983

When this is implemented, will that 1983-09 release now display as Sept, 1983 or Sept 1, 1983 on an album page?

You can test this live on https://feishin.vercel.app, but in my testing it would be Sep 1, 1983. Basically, take the string, treat it as UTC+0 and then display it that way (without time offsets).

Optekah commented 1 week ago

You can test this live on https://feishin.vercel.app

Just tried it and there's indeed a bug present where it incorrectly states it was released Sept 1, 1983 instead of just Sept, 1983.

Basically, take the string, treat it as UTC+0 and then display it that way (without time offsets).

As someone who has no dev experience, I have no idea what any of this means :P Is it a way for users to fix the above problem?

iiPythonx commented 1 week ago

Just tried it and there's indeed a bug present where it incorrectly states it was released Sept 1, 1983 instead of just Sept, 1983.

I don't recall there ever being an option for it to say Sept, 1983 rather then including the day. That could be added after-the-fact, but nothing you would be able to do (inside Feishin) without writing some more changes.

Optekah commented 1 week ago

Checking my Navidrome GUI, it correctly says Sept, 1983.

Just took a look at a different release that is tagged with only YYYY instead of one that is tagged YYYY-MM like my above example, and the way it's displayed is particularly egregious in its incorrectness. It displays as Jan 1, 2000 even though the band didn't even exist for at least another six or seven months after that— they met and formed sometime around June 2000.

I don't recall there ever being an option for it to say Sept, 1983 rather then including the day.

Would it be appropriate if I submit a separate issue for this to be changed / implemented?

I suppose it comes down to the concept that displaying no information is better than displaying wrong information; one I would assume most of us would agree with :P

kgarner7 commented 1 week ago

https://github.com/jeffvli/feishin/commit/730683fe2542318135c4fb2ce4c78f2f7b81ba41