forked from urish/ngx-moment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
0d545cc
There was a problem hiding this comment.
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 !?