cw-form-render-mobile
Version:
通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成
35 lines (34 loc) • 826 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getFormat = getFormat;
exports.translation = void 0;
function getFormat(format) {
switch (format) {
case 'date':
return 'YYYY-MM-DD';
case 'year':
return 'YYYY';
case 'month':
return 'YYYY-MM';
case 'week':
return 'YYYY-w';
case 'hour':
return 'YYYY-MM-DD hh';
case 'minute':
return 'YYYY-MM-DD hh:mm';
case 'second':
return 'YYYY-MM-DD hh:mm:ss';
case 'week-day':
return 'w-d';
default:
return 'YYYY-MM-DD';
}
}
var translation = exports.translation = function translation(configCtx) {
return function (key) {
var locale = configCtx === null || configCtx === void 0 ? void 0 : configCtx.locale.FormRender;
return locale[key];
};
};