ngx-moment
- Version 6.0.2
- Published
- 185 kB
- 1 dependency
- MIT license
Install
npm i ngx-moment
yarn add ngx-moment
pnpm add ngx-moment
Overview
Moment.JS pipes for Angular (timeago and more)
Index
Variables
Classes
Interfaces
Variables
variable NGX_MOMENT_OPTIONS
const NGX_MOMENT_OPTIONS: InjectionToken<NgxMomentOptions>;
Classes
class AddPipe
class AddPipe implements PipeTransform {}
class CalendarPipe
class CalendarPipe implements PipeTransform, OnDestroy {}
constructor
constructor(cdRef: ChangeDetectorRef, ngZone: NgZone);
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarPipe, never>;
property ɵpipe
static ɵpipe: i0.ɵɵPipeDeclaration<CalendarPipe, 'amCalendar'>;
method ngOnDestroy
ngOnDestroy: () => void;
method transform
transform: (value: moment.MomentInput, ...args: any[]) => any;
class DateFormatPipe
class DateFormatPipe implements PipeTransform {}
class DifferencePipe
class DifferencePipe implements PipeTransform {}
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<DifferencePipe, never>;
property ɵpipe
static ɵpipe: i0.ɵɵPipeDeclaration<DifferencePipe, 'amDifference'>;
method transform
transform: ( value: moment.MomentInput, otherValue: moment.MomentInput, unit?: moment.unitOfTime.Diff, precision?: boolean) => number;
class DurationPipe
class DurationPipe implements PipeTransform {}
constructor
constructor(momentOptions?: NgxMomentOptions);
property allowedUnits
allowedUnits: string[];
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<DurationPipe, [{ optional: true }]>;
property ɵpipe
static ɵpipe: i0.ɵɵPipeDeclaration<DurationPipe, 'amDuration'>;
method transform
transform: (value: moment.DurationInputArg1, ...args: string[]) => string;
class FromUnixPipe
class FromUnixPipe implements PipeTransform {}
class FromUtcPipe
class FromUtcPipe implements PipeTransform {}
class IsAfterPipe
class IsAfterPipe implements PipeTransform {}
class IsBeforePipe
class IsBeforePipe implements PipeTransform {}
class LocalePipe
class LocalePipe implements PipeTransform {}
class LocalTimePipe
class LocalTimePipe implements PipeTransform {}
class MomentModule
class MomentModule {}
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<MomentModule, never>;
property ɵinj
static ɵinj: i0.ɵɵInjectorDeclaration<MomentModule>;
property ɵmod
static ɵmod: i0.ɵɵNgModuleDeclaration< MomentModule, [ typeof i1.AddPipe, typeof i2.CalendarPipe, typeof i3.DateFormatPipe, typeof i4.DifferencePipe, typeof i5.DurationPipe, typeof i6.FromUnixPipe, typeof i7.ParsePipe, typeof i8.SubtractPipe, typeof i9.TimeAgoPipe, typeof i10.UtcPipe, typeof i11.FromUtcPipe, typeof i12.LocalTimePipe, typeof i13.LocalePipe, typeof i14.ParseZonePipe, typeof i15.IsBeforePipe, typeof i16.IsAfterPipe ], never, [ typeof i1.AddPipe, typeof i2.CalendarPipe, typeof i3.DateFormatPipe, typeof i4.DifferencePipe, typeof i5.DurationPipe, typeof i6.FromUnixPipe, typeof i7.ParsePipe, typeof i8.SubtractPipe, typeof i9.TimeAgoPipe, typeof i10.UtcPipe, typeof i11.FromUtcPipe, typeof i12.LocalTimePipe, typeof i13.LocalePipe, typeof i14.ParseZonePipe, typeof i15.IsBeforePipe, typeof i16.IsAfterPipe ]>;
method forRoot
static forRoot: ( options?: NgxMomentOptions) => ModuleWithProviders<MomentModule>;
class ParsePipe
class ParsePipe implements PipeTransform {}
class ParseZonePipe
class ParseZonePipe implements PipeTransform {}
class SubtractPipe
class SubtractPipe implements PipeTransform {}
class TimeAgoPipe
class TimeAgoPipe implements PipeTransform, OnDestroy {}
constructor
constructor(cdRef: ChangeDetectorRef, ngZone: NgZone);
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<TimeAgoPipe, never>;
property ɵpipe
static ɵpipe: i0.ɵɵPipeDeclaration<TimeAgoPipe, 'amTimeAgo'>;
method format
format: (m: moment.Moment) => string;
method ngOnDestroy
ngOnDestroy: () => void;
method transform
transform: ( value: moment.MomentInput, omitSuffix?: boolean, formatFn?: (m: moment.Moment) => string) => string;
Interfaces
interface NgxMomentOptions
interface NgxMomentOptions {}
property relativeTimeThresholdOptions
relativeTimeThresholdOptions: { [key: string]: number;};
relativeTimeThresholdOptions Provides the
relativeTimeThreshold
units allowing a pipe to set themoment.relativeTimeThreshold
values. Thekey
is a unit defined as one ofss
,s
,m
,h
,d
,M
.Example 1
by default more than 45 seconds is considered a minute, more than 22 hours is considered a day and so on. So settings the unit 'm' to
59
will adjust therelativeTimeThreshold
and consider more than 59 minutes to be an hour (default is45 minutes
)See Also
https://momentjs.com/docs/#/customization/relative-time-threshold/
Package Files (19)
- add.pipe.d.ts
- calendar.pipe.d.ts
- date-format.pipe.d.ts
- difference.pipe.d.ts
- duration.pipe.d.ts
- from-unix.pipe.d.ts
- from-utc.pipe.d.ts
- is-after.pipe.d.ts
- is-before.pipe.d.ts
- local.pipe.d.ts
- locale.pipe.d.ts
- moment-options.d.ts
- moment.module.d.ts
- ngx-moment.d.ts
- parse-zone.pipe.d.ts
- parse.pipe.d.ts
- subtract.pipe.d.ts
- time-ago.pipe.d.ts
- utc.pipe.d.ts
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ngx-moment
.
- Markdown[](https://www.jsdocs.io/package/ngx-moment)
- HTML<a href="https://www.jsdocs.io/package/ngx-moment"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 5452 ms. - Missing or incorrect documentation? Open an issue for this package.