IO-1043 Date sort fixes.

This commit is contained in:
Patrick Fic
2021-05-07 15:05:51 -07:00
parent c6f2aaeca6
commit cc541293eb
5 changed files with 28 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ import { createStructuredSelector } from "reselect";
import { setModalContext } from "../../redux/modals/modals.actions";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter } from "../../utils/DateFormatter";
import { alphaSort } from "../../utils/sorters";
import { alphaSort, dateSort } from "../../utils/sorters";
import { TemplateList } from "../../utils/TemplateConstants";
import BillDeleteButton from "../bill-delete-button/bill-delete-button.component";
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
@@ -112,7 +112,7 @@ export function BillsListTableComponent({
title: t("bills.fields.date"),
dataIndex: "date",
key: "date",
sorter: (a, b) => a.date - b.date,
sorter: (a, b) => dateSort(a.date, b.date),
sortOrder:
state.sortedInfo.columnKey === "date" && state.sortedInfo.order,
render: (text, record) => <DateFormatter>{record.date}</DateFormatter>,