mirror of https://github.com/Ombi-app/Ombi
parent
8a5804e088
commit
3afa775937
@ -0,0 +1,12 @@
|
||||
import { Pipe, PipeTransform } from "@angular/core";
|
||||
import * as moment from "moment";
|
||||
|
||||
const momentConstructor = moment;
|
||||
|
||||
@Pipe({ name: "amUserLocale" })
|
||||
export class UserLocalePipe implements PipeTransform {
|
||||
transform(value: moment.MomentInput): moment.Moment {
|
||||
const locale = navigator.language;
|
||||
return momentConstructor(value).locale(locale);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue