Skip to content

Commit

Permalink
fix(plan): fix breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedRashed007 authored and souvikbasu committed Jan 3, 2022
1 parent 3e7f043 commit 867571b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
8 changes: 4 additions & 4 deletions components/finance/FinanceMonthHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@material-ui/core'
import { createStyles, makeStyles } from '@material-ui/core/styles'
import React from 'react'

import { getMonth } from '../../../lib/date-helper'
import { getDate } from '../../../lib/date-helper'
import Loader from '../../common/Loader'

const useStyles = makeStyles(() =>
Expand Down Expand Up @@ -62,7 +62,7 @@ function FinanceMonthHeader({ endMonth, startMonth, activeColumn }: any) {
})

const classes = useStyles()
const todayDisplayDate = getMonth()
const todayDisplayDate = getDate()

if (loading || error)
return (
Expand All @@ -82,8 +82,8 @@ function FinanceMonthHeader({ endMonth, startMonth, activeColumn }: any) {
<>
{columnIndex === 0 && (
<div>
<p className="bg-plannedExpense h-8 w-8 text-sm text-center">Expenses</p>
<p className=" h-8 w-24 mt-4 text-sm text-center">Net Balance</p>
<p className="bg-plannedExpense h-8 w-24 text-sm text-center">Expenses</p>
<p className=" h-8 w-24 mt-2 text-sm text-center">Net Balance</p>
</div>
)}
<div key={x.month} className={`flex flex-col ${isEqual(columnIndex, activeColumn) && classes.isActive}`}>
Expand Down
10 changes: 0 additions & 10 deletions lib/date-helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ export function getDate(date = null)
return Moment(date, 'DD/MM/YYYY');
}

export function getMonth(date = null)
{
if (date === null)
{
return Moment(date).format('MMMM');
}

return Moment(date, "DD/MM/YYYY").format('MMMM');
}

export function getDateString(date: Moment.Moment)
{
return date.format('DD MMM YYYY')
Expand Down
4 changes: 2 additions & 2 deletions pages/finance/plan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useState } from 'react'
import ControlButtons from '../../components/common/ControlButtons'
import FinanceMonthHeader from '../../components/finance/FinanceMonthHeader'
import FinanceSwitch from '../../components/finance/FinanceSwitch'
import { dateAfterDays, dateBeforeDays } from '../../lib/date-helper'
import { dateAfterDays, getDate } from '../../lib/date-helper'

export default withPageAuthRequired(() => {
const marginLeft = 384
Expand All @@ -13,7 +13,7 @@ export default withPageAuthRequired(() => {
const dateColumns = Math.ceil(spreadSheetWidth / cellWidth)

const [values, setValues] = useState({
startMonth: dateBeforeDays(3),
startMonth: getDate(),
endMonth: dateAfterDays(Math.ceil(dateColumns * 22)),
})
const [activeCell] = useState([0, 0])
Expand Down

0 comments on commit 867571b

Please sign in to comment.