@fakel/rest-admin
Version:
An application that makes it easier to work with your API
13 lines (12 loc) • 510 B
JavaScript
import React from 'react';
import Typography from 'antd/lib/typography';
import Field from './Field';
var Text = Typography.Text;
var mapDateToFormat = function (date, format) {
return new Date(date).toLocaleDateString();
};
var DateField = function (props) {
var source = props.source, record = props.record;
return (React.createElement(Field, { source: source, record: record }, function (value) { return React.createElement(Text, null, mapDateToFormat(value)); }));
};
export default DateField;