mirror of
https://github.com/apache/superset.git
synced 2026-04-17 15:15:20 +00:00
refactor(moment): Replace Moment.js with DayJs (#31310)
This commit is contained in:
committed by
GitHub
parent
b382ef1058
commit
a193d790b2
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
import { SafeMarkdown, styled, t } from '@superset-ui/core';
|
||||
import Handlebars from 'handlebars';
|
||||
import moment from 'moment';
|
||||
import dayjs from 'dayjs';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { isPlainObject } from 'lodash';
|
||||
import Helpers from 'just-handlebars-helpers';
|
||||
@@ -78,7 +78,7 @@ export const HandlebarsViewer = ({
|
||||
// usage: {{dateFormat my_date format="MMMM YYYY"}}
|
||||
Handlebars.registerHelper('dateFormat', function (context, block) {
|
||||
const f = block.hash.format || 'YYYY-MM-DD';
|
||||
return moment(context).format(f);
|
||||
return dayjs(context).format(f);
|
||||
});
|
||||
|
||||
// usage: {{ }}
|
||||
|
||||
Reference in New Issue
Block a user