Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TimeUtils.getDate not using UTC for offset #2280

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

nielsvanvelzen
Copy link
Member

The SDK uses java.time but the old apiclient uses java.util.Date. The latter doesn't support timezones that great and guess what, the function that converted Date->java.time didn't either!

Changes

  • Fix TimeUtils.getDate not using UTC for offset causing displayed dates to be offset

Issues

Fixes #2279

@nielsvanvelzen nielsvanvelzen added the bug Something isn't working label Nov 21, 2022
@nielsvanvelzen nielsvanvelzen added this to the v0.15.0 milestone Nov 21, 2022
return getDate(date, ZoneOffset.UTC);
}

public static Date getDate(LocalDateTime date, ZoneId zone) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
return getDate(date, ZoneOffset.UTC);
}

public static Date getDate(LocalDateTime date, ZoneId zone) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
return getDate(date, ZoneOffset.UTC);
}

public static Date getDate(LocalDateTime date, ZoneId zone) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@nielsvanvelzen nielsvanvelzen merged commit ed06b5c into jellyfin:master Nov 22, 2022
@nielsvanvelzen nielsvanvelzen deleted the getDate-utc branch December 10, 2022 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect time in tv guide program description
2 participants