-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(date): rename
Date
component DateTime
- Loading branch information
Showing
5 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { html } from '@rbardini/html' | ||
import Date from './date.js' | ||
import DateTime from './date-time.js' | ||
|
||
/** | ||
* @param {string} startDate | ||
* @param {string} [endDate] | ||
* @returns {string} | ||
*/ | ||
export default function Duration(startDate, endDate) { | ||
if (endDate === startDate) return Date(endDate) | ||
return html`<time-duration>${Date(startDate)} – ${endDate ? Date(endDate) : 'Present'}</time-duration>` | ||
if (endDate === startDate) return DateTime(endDate) | ||
return html`<time-duration>${DateTime(startDate)} – ${endDate ? DateTime(endDate) : 'Present'}</time-duration>` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters