UNPKG

@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
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, format) { return moment(value).format(format); }; return DateFormatValueConverter; }(); });