mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
common: add fullTime helper
This commit is contained in:
16
js/src/common/helpers/fullTime.tsx
Normal file
16
js/src/common/helpers/fullTime.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* The `fullTime` helper displays a formatted time string wrapped in a <time>
|
||||
* tag.
|
||||
*/
|
||||
export default function fullTime(time: Date) {
|
||||
const mo = dayjs(time);
|
||||
|
||||
const datetime = mo.format();
|
||||
const full = mo.format('LLLL');
|
||||
|
||||
return (
|
||||
<time pubdate datetime={datetime}>
|
||||
{full}
|
||||
</time>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user