Skip to content
Snippets Groups Projects
Commit c21ed1bd authored by Saúl Ibarra Corretgé's avatar Saúl Ibarra Corretgé
Browse files

Separate conference start time and duration into 2 lines

parent 56e0588e
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,10 @@ class RecentList extends Component<Props, *> {
{ this._renderServerURL(conference.serverURL) }
</TruncatedText>
<TruncatedText>
{ this._renderTimeAndDuration(conference) }
{ this._renderStartTime(conference) }
</TruncatedText>
<TruncatedText>
{ this._renderDuration(conference) }
</TruncatedText>
</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.
* @returns {string} - Date/Time and Duration.
*/
_renderTimeAndDuration(conference: RecentListItem) {
_renderDuration(conference: RecentListItem) {
const { startTime, endTime } = conference;
const start = moment(startTime);
const end = moment(endTime);
const duration = moment.duration(end.diff(start)).humanize();
const end = moment(endTime || Date.now());
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 `${start.calendar()}, ${duration}`;
return moment(startTime).calendar();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment