mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
26 lines
706 B
TypeScript
26 lines
706 B
TypeScript
import {Pipe, PipeTransform} from '@angular/core';
|
|
import {SortingMethods} from '../../../common/entities/SortingMethods';
|
|
|
|
|
|
@Pipe({name: 'stringifySorting'})
|
|
export class StringifySortingMethod implements PipeTransform {
|
|
constructor() {
|
|
}
|
|
|
|
transform(method: SortingMethods): string {
|
|
switch (method) {
|
|
case SortingMethods.ascName:
|
|
return $localize`ascending name`;
|
|
case SortingMethods.descName:
|
|
return $localize`descending name`;
|
|
case SortingMethods.ascDate:
|
|
return $localize`ascending date`;
|
|
case SortingMethods.descDate:
|
|
return $localize`descending date`;
|
|
case SortingMethods.random:
|
|
return $localize`random`;
|
|
}
|
|
}
|
|
}
|
|
|