mirror of
https://github.com/netzbegruenung/jitsi-meet-electron.git
synced 2024-05-04 01:33:42 +02:00
Separate conference start time and duration into 2 lines
This commit is contained in:
parent
56e0588efc
commit
c21ed1bdaa
|
@ -76,7 +76,10 @@ class RecentList extends Component<Props, *> {
|
||||||
{ this._renderServerURL(conference.serverURL) }
|
{ this._renderServerURL(conference.serverURL) }
|
||||||
</TruncatedText>
|
</TruncatedText>
|
||||||
<TruncatedText>
|
<TruncatedText>
|
||||||
{ this._renderTimeAndDuration(conference) }
|
{ this._renderStartTime(conference) }
|
||||||
|
</TruncatedText>
|
||||||
|
<TruncatedText>
|
||||||
|
{ this._renderDuration(conference) }
|
||||||
</TruncatedText>
|
</TruncatedText>
|
||||||
</ConferenceCard>
|
</ConferenceCard>
|
||||||
);
|
);
|
||||||
|
@ -95,18 +98,29 @@ class RecentList extends Component<Props, *> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns Date/Time and Duration of the conference in string format.
|
* Returns the duration of the conference in string format.
|
||||||
*
|
*
|
||||||
* @param {RecentListItem} conference - Conference Details.
|
* @param {RecentListItem} conference - Conference Details.
|
||||||
* @returns {string} - Date/Time and Duration.
|
* @returns {string} - Date/Time and Duration.
|
||||||
*/
|
*/
|
||||||
_renderTimeAndDuration(conference: RecentListItem) {
|
_renderDuration(conference: RecentListItem) {
|
||||||
const { startTime, endTime } = conference;
|
const { startTime, endTime } = conference;
|
||||||
const start = moment(startTime);
|
const start = moment(startTime);
|
||||||
const end = moment(endTime);
|
const end = moment(endTime || Date.now());
|
||||||
const duration = moment.duration(end.diff(start)).humanize();
|
|
||||||
|
|
||||||
return `${start.calendar()}, ${duration}`;
|
return moment.duration(end.diff(start)).humanize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Date/Time of the conference in string format.
|
||||||
|
*
|
||||||
|
* @param {RecentListItem} conference - Conference Details.
|
||||||
|
* @returns {string} - Date/Time and Duration.
|
||||||
|
*/
|
||||||
|
_renderStartTime(conference: RecentListItem) {
|
||||||
|
const { startTime } = conference;
|
||||||
|
|
||||||
|
return moment(startTime).calendar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue