feat: remove all instances of moment usage

This commit is contained in:
Sérgio Salgado 2021-11-23 16:09:15 +00:00
parent 7d6fb17158
commit 973040f409
29 changed files with 252 additions and 193 deletions

View file

@ -1,7 +1,7 @@
import BigNumber from 'bignumber.js'
import * as d3 from 'd3'
import { add, format, startOfWeek, startOfYear } from 'date-fns'
import { getTimezoneOffset } from 'date-fns-tz'
import moment from 'moment'
import * as R from 'ramda'
import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react'
@ -87,8 +87,13 @@ const Graph = ({
const previousDateWeekday = previousDate.getUTCDay()
const previousDateMonth = previousDate.getUTCMonth()
const daysOfWeek = moment.weekdaysShort()
const months = moment.monthsShort()
const daysOfWeek = Array.from(Array(7)).map((_, i) =>
format(add(startOfWeek(new Date()), { days: i }), 'EEE')
)
const months = Array.from(Array(12)).map((_, i) =>
format(add(startOfYear(new Date()), { months: i }), 'LLL')
)
return {
previous: