1 | "use strict";
|
2 |
|
3 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
4 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
5 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
6 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
7 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
8 | };
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | var core_1 = require("@angular/core");
|
11 | var moment = require("moment");
|
12 | var AddPipe = (function () {
|
13 | function AddPipe() {
|
14 | }
|
15 | AddPipe.prototype.transform = function (value, amount, unit) {
|
16 | if (typeof amount === 'undefined' || (typeof amount === 'number' && typeof unit === 'undefined')) {
|
17 | throw new Error('AddPipe: missing required arguments');
|
18 | }
|
19 | return moment(value).add(amount, unit);
|
20 | };
|
21 | AddPipe = __decorate([
|
22 | core_1.Pipe({ name: 'amAdd' })
|
23 | ], AddPipe);
|
24 | return AddPipe;
|
25 | }());
|
26 | exports.AddPipe = AddPipe;
|
27 |
|
\ | No newline at end of file |