mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-31 09:21:27 +00:00
remove 'show both' date option in DateTime
This commit is contained in:
parent
706c4afd04
commit
951d7bbb63
1 changed files with 3 additions and 6 deletions
|
@ -12,7 +12,6 @@ type Props = {
|
||||||
class DateTime extends React.PureComponent<Props> {
|
class DateTime extends React.PureComponent<Props> {
|
||||||
static SHOW_DATE = 'date';
|
static SHOW_DATE = 'date';
|
||||||
static SHOW_TIME = 'time';
|
static SHOW_TIME = 'time';
|
||||||
static SHOW_BOTH = 'both';
|
|
||||||
|
|
||||||
static getTimeAgoStr(date: any) {
|
static getTimeAgoStr(date: any) {
|
||||||
const suffixList = ['years', 'months', 'days', 'hours', 'minutes', 'seconds', ''];
|
const suffixList = ['years', 'months', 'days', 'hours', 'minutes', 'seconds', ''];
|
||||||
|
@ -41,8 +40,7 @@ class DateTime extends React.PureComponent<Props> {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { date, timeAgo } = this.props;
|
const { date, timeAgo, show } = this.props;
|
||||||
const show = this.props.show || DateTime.SHOW_BOTH;
|
|
||||||
|
|
||||||
if (timeAgo) {
|
if (timeAgo) {
|
||||||
if (!date) {
|
if (!date) {
|
||||||
|
@ -54,9 +52,8 @@ class DateTime extends React.PureComponent<Props> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{date && (show === DateTime.SHOW_BOTH || show === DateTime.SHOW_DATE) && moment(date).format('MMMM Do, YYYY')}
|
{date && show === DateTime.SHOW_DATE && moment(date).format('MMMM Do, YYYY')}
|
||||||
{show === DateTime.SHOW_BOTH && ' '}
|
{date && show === DateTime.SHOW_TIME && moment(date).format('hh:mm A')}
|
||||||
{date && (show === DateTime.SHOW_BOTH || show === DateTime.SHOW_TIME) && date.toLocaleTimeString()}
|
|
||||||
{!date && '...'}
|
{!date && '...'}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue