UNPKG

@aappddeevv/dynamics-client-ui

Version:

## What is it? A library to help you create great dynamics applications.

25 lines 950 B
"use strict"; /** * Utilities for working the data model. */ Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); tslib_1.__exportStar(require("./time"), exports); const time_1 = require("./time"); exports.formattedValuePostfix = "@OData.Community.Display.V1.FormattedValue"; /** Convert an attribute name to one with a OData formatted value. */ function toFVName(name) { return name + exports.formattedValuePostfix; } exports.toFVName = toFVName; /** * Copies object and adds DateStr attributse if corresponding Model.Audit attributes exist. */ function enhanceAudit(audit, format = time_1.momentDateFormat) { const x = Object.assign({}, audit); x.modifiedonstr = x.modifiedon ? time_1.formatDate(x.modifiedon) : null; x.createdonstr = x.createdon ? time_1.formatDate(x.createdon) : null; return x; } exports.enhanceAudit = enhanceAudit; //# sourceMappingURL=DataModel.Utils.js.map