Skip to content

Commit

Permalink
Fix release date parsing to use UTC (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Oct 15, 2024
1 parent 3a63ee4 commit d3480a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/renderer/api/navidrome/navidrome-normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const normalizeSong = (
playlistItemId,
releaseDate: (item.releaseDate
? new Date(item.releaseDate)
: new Date(item.year, 0, 1)
: new Date(Date.UTC(item.year, 0, 1))
).toISOString(),
releaseYear: String(item.year),
serverId: server?.id || 'unknown',
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/api/subsonic/subsonic-normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const normalizeAlbum = (
name: item.name,
originalDate: null,
playCount: null,
releaseDate: item.year ? new Date(item.year, 0, 1).toISOString() : null,
releaseDate: item.year ? new Date(Date.UTC(item.year, 0, 1)).toISOString() : null,
releaseYear: item.year ? Number(item.year) : null,
serverId: server?.id || 'unknown',
serverType: ServerType.SUBSONIC,
Expand Down

0 comments on commit d3480a8

Please sign in to comment.