System.register(["__unresolved_0"], function (_export, _context) {
  "use strict";

  var _loader, _cjsExports, __cjsMetaURL;

  _export("default", void 0);

  return {
    setters: [function (_unresolved_) {
      _loader = _unresolved_.default;
    }],
    execute: function () {
      _loader.define(_context.meta.url, function (exports, _require, module, __filename, __dirname) {
        var require = _loader.createRequireWithReqMap({}, _require);

        (function () {
          ///<reference path="index.d.ts"/>
          function prependZero(matched, num) {
            return matched.length > 1 && num < 10 ? "0" + num : "" + num;
          }

          Date.prototype.format = function (pattern) {
            var _this = this;

            if (pattern === void 0) {
              pattern = 'YYYY-MM-DD hh:mm:ss';
            }

            return pattern.replace(/y{2,}|Y{2,}/, function (v) {
              return (_this.getFullYear() + "").substr(4 - v.length);
            }).replace(/M{1,2}/, function (v) {
              return prependZero(v, _this.getMonth() + 1);
            }).replace(/D{1,2}|d{1,2}/, function (v) {
              return prependZero(v, _this.getDate());
            }).replace(/Q|q/, function (v) {
              return prependZero(v, Math.ceil((_this.getMonth() + 1) / 3));
            }).replace(/h{1,2}|H{1,2}/, function (v) {
              return prependZero(v, _this.getHours());
            }).replace(/m{1,2}/, function (v) {
              return prependZero(v, _this.getMinutes());
            }).replace(/s{1,2}/, function (v) {
              return prependZero(v, _this.getSeconds());
            }).replace(/SSS|S/, function (v) {
              var ms = '' + _this.getMilliseconds();

              return v.length === 1 ? ms : "" + (ms.length === 1 ? '00' : ms.length === 2 ? '0' : '') + ms;
            });
          };

          Date.today = function () {
            var now = new Date();
            return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
          };
        })();

        _export("default", _cjsExports = module.exports);
      });

      _export("__cjsMetaURL", __cjsMetaURL = _context.meta.url);
    }
  };
});
//# sourceMappingURL=index.js.map