mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
refactor(moment): Replace Moment.js with DayJs (#31310)
This commit is contained in:
committed by
GitHub
parent
b382ef1058
commit
a193d790b2
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
import { useMemo, ReactNode } from 'react';
|
||||
import moment from 'moment';
|
||||
import Card from 'src/components/Card';
|
||||
import ProgressBar from 'src/components/ProgressBar';
|
||||
import { t, useTheme, QueryResponse } from '@superset-ui/core';
|
||||
@@ -32,7 +31,7 @@ import {
|
||||
} from 'src/SqlLab/actions/sqlLab';
|
||||
import TableView from 'src/components/TableView';
|
||||
import Button from 'src/components/Button';
|
||||
import { fDuration } from 'src/utils/dates';
|
||||
import { fDuration, extendedDayjs } from 'src/utils/dates';
|
||||
import Icons from 'src/components/Icons';
|
||||
import Label from 'src/components/Label';
|
||||
import { Tooltip } from 'src/components/Tooltip';
|
||||
@@ -255,7 +254,9 @@ const QueryTable = ({
|
||||
</Button>
|
||||
);
|
||||
q.started = (
|
||||
<Label monospace>{moment(q.startDttm).format('L HH:mm:ss')}</Label>
|
||||
<Label monospace>
|
||||
{extendedDayjs(q.startDttm).format('L HH:mm:ss')}
|
||||
</Label>
|
||||
);
|
||||
q.querylink = (
|
||||
<Button
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
VizType,
|
||||
} from '@superset-ui/core';
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
import moment from 'moment';
|
||||
import dayjs from 'dayjs';
|
||||
import rison from 'rison';
|
||||
import { createDatasource } from 'src/SqlLab/actions/sqlLab';
|
||||
import { addDangerToast } from 'src/components/MessageToasts/actions';
|
||||
@@ -164,7 +164,7 @@ export const SaveDatasetModal = ({
|
||||
);
|
||||
|
||||
const getDefaultDatasetName = () =>
|
||||
`${datasource?.name || UNTITLED} ${moment().format('L HH:mm:ss')}`;
|
||||
`${datasource?.name || UNTITLED} ${dayjs().format('L HH:mm:ss')}`;
|
||||
const [datasetName, setDatasetName] = useState(getDefaultDatasetName());
|
||||
const [newOrOverwrite, setNewOrOverwrite] = useState(
|
||||
DatasetRadioState.SaveNew,
|
||||
|
||||
Reference in New Issue
Block a user