mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2024-11-27 08:00:28 +00:00
Fix cast exception in ChannelCardView
This commit is contained in:
parent
b1356ac6a0
commit
fd5ca3ffea
@ -7,6 +7,7 @@ import android.widget.FrameLayout;
|
||||
|
||||
import org.jellyfin.androidtv.R;
|
||||
import org.jellyfin.androidtv.databinding.ViewCardChannelBinding;
|
||||
import org.jellyfin.androidtv.util.TimeUtils;
|
||||
import org.jellyfin.sdk.model.api.BaseItemDto;
|
||||
|
||||
import java.time.Duration;
|
||||
@ -36,8 +37,8 @@ public class ChannelCardView extends FrameLayout {
|
||||
private void updateDisplay(BaseItemDto program) {
|
||||
binding.program.setText(program.getName());
|
||||
if (program.getStartDate() != null && program.getEndDate() != null) {
|
||||
binding.time.setText(DateFormat.getTimeFormat(getContext()).format(program.getStartDate())
|
||||
+ "-" + DateFormat.getTimeFormat(getContext()).format(program.getEndDate()));
|
||||
binding.time.setText(DateFormat.getTimeFormat(getContext()).format(TimeUtils.getDate(program.getStartDate()))
|
||||
+ "-" + DateFormat.getTimeFormat(getContext()).format(TimeUtils.getDate(program.getEndDate())));
|
||||
|
||||
if (program.getStartDate().isAfter(LocalDateTime.now()) && program.getEndDate().isBefore(LocalDateTime.now())) {
|
||||
Duration duration = Duration.between(program.getStartDate(), program.getEndDate());
|
||||
|
Loading…
Reference in New Issue
Block a user