1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/src/frontend/app/pipes/StringifySortingMethod.ts
2021-04-17 20:06:17 +02:00

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`;
}
}
}