mirror of
https://github.com/flarum/core.git
synced 2025-10-13 07:54:25 +02:00
Switch from 'moment' to 'dayjs' (#2219)
* Switch from 'moment' to 'dayjs' * Use humanize code from duration plugin (without actual plugin) for time lapsed events
This commit is contained in:
committed by
GitHub
parent
640cc0989b
commit
8dd5420405
@@ -6,10 +6,10 @@
|
||||
* @return {Object}
|
||||
*/
|
||||
export default function fullTime(time) {
|
||||
const mo = moment(time);
|
||||
const d = dayjs(time);
|
||||
|
||||
const datetime = mo.format();
|
||||
const full = mo.format('LLLL');
|
||||
const datetime = d.format();
|
||||
const full = d.format('LLLL');
|
||||
|
||||
return (
|
||||
<time pubdate datetime={datetime}>
|
||||
|
@@ -9,10 +9,10 @@ import humanTimeUtil from '../utils/humanTime';
|
||||
* @return {Object}
|
||||
*/
|
||||
export default function humanTime(time) {
|
||||
const mo = moment(time);
|
||||
const d = dayjs(time);
|
||||
|
||||
const datetime = mo.format();
|
||||
const full = mo.format('LLLL');
|
||||
const datetime = d.format();
|
||||
const full = d.format('LLLL');
|
||||
const ago = humanTimeUtil(time);
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user