F: season page: add mark episode/season as watched

This commit is contained in:
X4Lo committed 2025-02-18 20:28:55 +01:00
1 parent 30ad2fbf03
commit 09cd4b205a
13 files changed
+187 -63

No files matched your search

@@ -9,7 +9,6 @@ import {
animate,
} from '@angular/animations';
import { formatDate } from '@angular/common';
import flatpickr from 'flatpickr';
@Component({
selector: 'app-seen-modal',
@@ -34,6 +33,9 @@ import flatpickr from 'flatpickr';
],
})
export class SeenModalComponent implements OnInit {
title: string = 'Watch Details';
hideSeenWith: boolean = false;
public watchDate: string = '';
public watchedWith: string = '';
@@ -43,8 +45,19 @@ export class SeenModalComponent implements OnInit {
) {}
ngOnInit(): void {
if (!this.data || !this.data.watchDate) {
// ? no initial data was passed: populate date field with current date
if (this.data.title) {
this.title = this.data.title;
}
if (this.data.watchedWith)
this.watchedWith = this.data.watchedWith.split(', ').join('\n');
if (this.data.hideSeenWith) {
this.hideSeenWith = this.data.hideSeenWith;
}
// ? no initial data was passed: populate date field with current date
if (!this.data.watchDate) {
this.watchDate = formatDate(new Date(), 'yyyy-MM-dd', 'en-US');
} else {
// ? if data is passed, populate fields
@@ -53,17 +66,7 @@ export class SeenModalComponent implements OnInit {
'yyyy-MM-dd',
'en-US'
);
this.watchedWith = this.data.watchedWith.split(', ').join('\n');
}
// flatpickr('#myDatepicker', {
// inline: true,
// defaultDate: this.watchDate,
// altInput: true,
// allowInput: false,
// altFormat: 'F j, Y',
// dateFormat: 'Y-m-d',
// });
}
onConfirm(): void {