react-bsonschema-form
Advanced tools
Comparing version 0.42.30 to 0.42.31
@@ -25,2 +25,16 @@ 'use strict'; | ||
function stringifyDate(_ref) { | ||
var date = _ref.date, | ||
utc = _ref.utc; | ||
if (date == null) { | ||
return date; | ||
} | ||
if (utc) { | ||
return (0, _moment2.default)(date).utc().format('L LT'); | ||
} else { | ||
return (0, _moment2.default)(date).format('L LT'); | ||
} | ||
} | ||
function cleanValue(value) { | ||
@@ -38,11 +52,16 @@ if (value && typeof value.toDate === 'function') { | ||
readonly = props.readonly, | ||
disabled = props.disabled; | ||
disabled = props.disabled, | ||
uiSchema = props.uiSchema; | ||
var StringField = props.registry.fields.StringField; | ||
var utc = uiSchema['ui:options'].utc; | ||
if (readonly || disabled) { | ||
var formDataString = stringifyDate({ date: formData, utc: utc }); | ||
return _react2.default.createElement(StringField, _extends({}, props, { | ||
formData: formData && (0, _moment2.default)(formData).format('L LT') })); | ||
formData: formDataString })); | ||
} else { | ||
return _react2.default.createElement(_reactDatetime2.default, _extends({}, props, { | ||
utc: utc, | ||
input: true, | ||
timeFormat: false, | ||
@@ -49,0 +68,0 @@ value: formData, |
{ | ||
"name": "react-bsonschema-form", | ||
"version": "0.42.30", | ||
"version": "0.42.31", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3888156
50
5157