mirror of
https://github.com/strapi/strapi.git
synced 2025-08-09 09:14:49 +00:00
Fix date display in ctm
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
2b8cae78c6
commit
5d57fcc1b5
@ -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;
|
||||||
|
@ -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 '••••••••';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user