mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-06 22:19:41 +03:00
fixed time issue
This commit is contained in:
parent
3e6b5d6673
commit
5fab7325fa
@ -53,7 +53,7 @@ class PostListItemView extends Component {
|
||||
<View style={styles.header}>
|
||||
<PostHeaderDescription
|
||||
// date={intl.formatRelative(created)}
|
||||
date={getTimeFromNow(created)}
|
||||
date={getTimeFromNow(created, true)}
|
||||
name={username}
|
||||
reputation={reputation}
|
||||
size={32}
|
||||
|
@ -11,9 +11,11 @@ const THIS_MONTH = moment()
|
||||
.subtract(1, 'M')
|
||||
.startOf('day');
|
||||
|
||||
export const getTimeFromNow = (value) => {
|
||||
export const getTimeFromNow = (value, isWithoutUtc) => {
|
||||
if (!value) return null;
|
||||
|
||||
if (isWithoutUtc) return moment(value).fromNow();
|
||||
|
||||
return moment.utc(value).fromNow();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user