Fix date display in ctm

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-04-16 13:56:07 +02:00
parent 2b8cae78c6
commit 5d57fcc1b5
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import moment from 'moment'; import moment from 'moment';
const dateToUtcTime = date => moment(date).utc(); const dateToUtcTime = date => moment.parseZone(date).utc();
export default dateToUtcTime; export default dateToUtcTime;

View File

@ -3,7 +3,7 @@ import { withRouter } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { get, isEmpty, isNull, isObject, toLower, toString } from 'lodash'; import { get, isEmpty, isNull, isObject, toLower, toString } from 'lodash';
import moment from 'moment'; import moment from 'moment';
import { dateToUtcTime, IcoContainer, useGlobalContext } from 'strapi-helper-plugin'; import { IcoContainer, useGlobalContext } from 'strapi-helper-plugin';
import useListView from '../../hooks/useListView'; import useListView from '../../hooks/useListView';
import dateFormats from '../../utils/dateFormats'; import dateFormats from '../../utils/dateFormats';
import CustomInputCheckbox from '../CustomInputCheckbox'; import CustomInputCheckbox from '../CustomInputCheckbox';
@ -37,7 +37,7 @@ const getDisplayedValue = (type, value, name) => {
const date = const date =
value && isObject(value) && value._isAMomentObject === true ? JSON.stringify(value) : value; value && isObject(value) && value._isAMomentObject === true ? JSON.stringify(value) : value;
return dateToUtcTime(date).format(dateFormats[type]); return moment(date).format(dateFormats[type]);
} }
case 'password': case 'password':
return '••••••••'; return '••••••••';