json-theme-even-fork/components/duration.js

12 lines
287 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import html from '../utils/html.js'
import Date from './date.js'
/**
* @param {string} startDate
* @param {string} [endDate]
* @returns {string}
*/
export default function Duration(startDate, endDate) {
return html`${Date(startDate)} ${endDate ? Date(endDate) : 'Present'}`
}