Skip to content

Commit

Permalink
Implement amLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
reberinformatik authored May 8, 2017
1 parent 175f220 commit 0d545cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/local.pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Pipe, PipeTransform } from '@angular/core';
import * as moment from 'moment';

// under systemjs, moment is actually exported as the default export, so we account for that
const momentConstructor: (value?: any) => moment.Moment = (<any>moment).default || moment;

@Pipe({ name: 'amLocal' })
export class LocalTimePipe implements PipeTransform {
transform(value: Date | moment.Moment | string | number): moment.Moment {
return moment(value).local();
}
}

1 comment on commit 0d545cc

@LucasBrazi06
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this file has been added to the version 1.3.3, right !?

Please sign in to comment.