"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    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;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require("@angular/core");
var moment = require("moment");
var typescript_angular_utilities_1 = require("typescript-angular-utilities");
var __dateFormats = typescript_angular_utilities_1.services.date.defaultFormats;
var __object = typescript_angular_utilities_1.services.object;
var DatePipe = (function () {
    function DatePipe(object) {
        this.object = object;
    }
    DatePipe.prototype.transform = function (date, includeTime) {
        if (this.object.isNullOrEmpty(date)) {
            return '';
        }
        var momentDate = moment(date);
        if (includeTime) {
            return momentDate.format(__dateFormats.dateTimeFormat) + ' ' + momentDate.zoneAbbr();
        }
        else {
            return momentDate.format(__dateFormats.dateFormat);
        }
    };
    return DatePipe;
}());
DatePipe = __decorate([
    core_1.Pipe({ name: 'rlDate' }),
    __metadata("design:paramtypes", [__object.ObjectUtility])
], DatePipe);
exports.DatePipe = DatePipe;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZGF0ZS5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxzQ0FBb0Q7QUFDcEQsK0JBQWlDO0FBRWpDLDZFQUF3RDtBQUN4RCxJQUFPLGFBQWEsR0FBRyx1Q0FBUSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUM7QUFDcE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