UNPKG

1.41 kBJavaScriptView Raw
1"use strict";
2/* angular2-moment (c) 2015, 2016 Uri Shaked / MIT Licence */
3var __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};
9Object.defineProperty(exports, "__esModule", { value: true });
10var core_1 = require("@angular/core");
11var moment = require("moment");
12var FromUnixPipe = /** @class */ (function () {
13 function FromUnixPipe() {
14 }
15 FromUnixPipe.prototype.transform = function (value) {
16 var args = [];
17 for (var _i = 1; _i < arguments.length; _i++) {
18 args[_i - 1] = arguments[_i];
19 }
20 if (typeof value === 'string') {
21 value = +value;
22 }
23 return moment.unix(value);
24 };
25 FromUnixPipe = __decorate([
26 core_1.Pipe({ name: 'amFromUnix' })
27 ], FromUnixPipe);
28 return FromUnixPipe;
29}());
30exports.FromUnixPipe = FromUnixPipe;
31//# sourceMappingURL=from-unix.pipe.js.map
\No newline at end of file