Localized Dates (#2182)

* Removed 4 properties from SiteThemeDto which weren't supposed to be there.

* Removed another set of date fields not used on DTOs

* Hangfire jobs will now grab a utc date and render that date in user's local timezone.

* Scrobble errors are now localized dates.

Added simplified chinese language code

* Fixed a bunch of newlines in the translation files

* Localized compact number and fixed some missing localizations

* Fixed remove from on deck key issue

* Scrobble events is now localized

* Scrobble events is now localized

* Removed some duplicate fields from chapter
This commit is contained in:
Joe Milazzo 2023-08-05 14:02:35 -05:00 committed by GitHub
parent c3b3f9a640
commit a65963c817
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 99 additions and 150 deletions

View file

@ -22,10 +22,10 @@
<table class="table table-striped table-hover table-sm scrollable">
<thead>
<tr>
<th scope="col" sortable="created" (sort)="updateSort($event)">
<th scope="col" sortable="createdUtc" (sort)="updateSort($event)">
{{t('created-header')}}
</th>
<th scope="col" sortable="lastModified" (sort)="updateSort($event)" direction="desc">
<th scope="col" sortable="lastModifiedUtc" (sort)="updateSort($event)" direction="desc">
{{t('last-modified-header')}}
</th>
<th scope="col">
@ -48,10 +48,10 @@
</tr>
<tr *ngFor="let item of events; let idx = index;">
<td>
{{item.created | date:'MM/dd/yy h:mm a' }}
{{item.createdUtc | translocoDate: {dateStyle: 'short', timeStyle: 'medium', } | defaultValue }}
</td>
<td>
{{item.lastModified | date:'MM/dd/yy h:mm a' }}
{{item.lastModifiedUtc | translocoDate: {dateStyle: 'short', timeStyle: 'medium' } | defaultValue }}
</td>
<td>
{{item.scrobbleEventType | scrobbleEventType}}

View file

@ -12,11 +12,13 @@ import {PaginatedResult, Pagination} from "../../_models/pagination";
import {SortableHeader, SortEvent} from "../table/_directives/sortable-header.directive";
import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms";
import {TranslocoModule} from "@ngneat/transloco";
import {DefaultValuePipe} from "../../pipe/default-value.pipe";
import {TranslocoLocaleModule} from "@ngneat/transloco-locale";
@Component({
selector: 'app-user-scrobble-history',
standalone: true,
imports: [CommonModule, ScrobbleEventTypePipe, NgbPagination, ReactiveFormsModule, SortableHeader, TranslocoModule],
imports: [CommonModule, ScrobbleEventTypePipe, NgbPagination, ReactiveFormsModule, SortableHeader, TranslocoModule, DefaultValuePipe, TranslocoLocaleModule],
templateUrl: './user-scrobble-history.component.html',
styleUrls: ['./user-scrobble-history.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
@ -36,7 +38,7 @@ export class UserScrobbleHistoryComponent implements OnInit {
get ScrobbleEventType() { return ScrobbleEventType; }
ngOnInit() {
this.loadPage({column: 'created', direction: 'desc'});
this.loadPage({column: 'createdUtc', direction: 'desc'});
this.formGroup.get('filter')?.valueChanges.pipe(debounceTime(200), takeUntilDestroyed(this.destroyRef)).subscribe(query => {
this.loadPage();
@ -81,9 +83,9 @@ export class UserScrobbleHistoryComponent implements OnInit {
private mapSortColumnField(column: string | undefined) {
switch (column) {
case 'created': return ScrobbleEventSortField.Created;
case 'createdUtc': return ScrobbleEventSortField.Created;
case 'isProcessed': return ScrobbleEventSortField.IsProcessed;
case 'lastModified': return ScrobbleEventSortField.LastModified;
case 'lastModifiedUtc': return ScrobbleEventSortField.LastModified;
case 'seriesName': return ScrobbleEventSortField.Series;
}
return ScrobbleEventSortField.None;