mirror of
https://github.com/flarum/framework.git
synced 2024-12-11 21:43:38 +08:00
20 lines
357 B
JavaScript
20 lines
357 B
JavaScript
/**
|
|
* The `fullTime` helper displays a formatted time string wrapped in a <time>
|
|
* tag.
|
|
*
|
|
* @param {Date} time
|
|
* @return {Object}
|
|
*/
|
|
export default function fullTime(time) {
|
|
const mo = moment(time);
|
|
|
|
const datetime = mo.format();
|
|
const full = mo.format('LLLL');
|
|
|
|
return (
|
|
<time pubdate datetime={datetime}>
|
|
{full}
|
|
</time>
|
|
);
|
|
}
|