Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix certificate date format #1974

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { Button, Grid, Tooltip } from '@mui/material'
import FilePresentIcon from '@mui/icons-material/FilePresent'
import Link from 'next/link'
import { expenseFileUrl } from 'common/util/expenseFileUrls'
import { getExactDate } from 'common/util/date'
import { bg, enUS } from 'date-fns/locale'

const PREFIX = 'Grid'

Expand Down Expand Up @@ -43,12 +45,13 @@ const Root = styled(Grid)({
})

export default observer(function CampaignPublicExpensesGrid({ slug }: Props) {
const { t } = useTranslation('')
const { t, i18n } = useTranslation('')
const { data: expensesList } = useCampaignApprovedExpensesList(slug)
const [paginationModel, setPaginationModel] = useState({
pageSize: 20,
page: 0,
})
const locale = i18n?.language == 'bg' ? bg : enUS

const columns: GridColDef[] = [
{ field: 'id', headerName: 'ID' },
Expand Down Expand Up @@ -96,8 +99,7 @@ export default observer(function CampaignPublicExpensesGrid({ slug }: Props) {
if (!params.row.spentAt) {
return ''
}

return new Date(params.row.spentAt).toLocaleDateString()
return getExactDate(params.row.spentAt, locale)
},
},
{
Expand Down
Loading