Skip to content

Instantly share code, notes, and snippets.

@cherepanov
Last active February 4, 2023 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cherepanov/40d1dd64be4f61e11bf67fe16ce733ac to your computer and use it in GitHub Desktop.
Save cherepanov/40d1dd64be4f61e11bf67fe16ce733ac to your computer and use it in GitHub Desktop.
dayjs config
import 'dayjs/locale/ru';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import dayjs from 'dayjs';
import dayOfYear from 'dayjs/plugin/dayOfYear';
import devHelper from 'dayjs/plugin/devHelper';
import duration from 'dayjs/plugin/duration';
import type { Duration } from 'dayjs/plugin/duration';
import isoWeek from 'dayjs/plugin/isoWeek';
import relativeTime from 'dayjs/plugin/relativeTime';
import toObject from 'dayjs/plugin/toObject';
import utc from 'dayjs/plugin/utc';
import weekday from 'dayjs/plugin/weekday';
import { isDev } from './const';
dayjs.locale('ru');
dayjs.extend(relativeTime);
dayjs.extend(customParseFormat);
dayjs.extend(dayOfYear);
dayjs.extend(isoWeek);
dayjs.extend(weekday);
dayjs.extend(duration);
dayjs.extend(toObject);
dayjs.extend(utc);
if (isDev) {
dayjs.extend(devHelper);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment