@danielkalen/simplybind
Version:
Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.
45 lines (36 loc) • 1.14 kB
JavaScript
define(['exports', 'moment'], function (exports, _moment) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateFormatValueConverter = undefined;
var moment = _interopRequireWildcard(_moment);
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
}
}
newObj.default = obj;
return newObj;
}
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var DateFormatValueConverter = exports.DateFormatValueConverter = function () {
function DateFormatValueConverter() {
_classCallCheck(this, DateFormatValueConverter);
}
DateFormatValueConverter.prototype.toView = function toView(value) {
return moment(value).format('M/D/YYYY h:mm:ss a');
};
return DateFormatValueConverter;
}();
});