add date added to summary

ref #271
This commit is contained in:
Collin M. Barrett 2018-06-08 11:36:23 -05:00
parent 89aeec3641
commit 2a4368b96a
2 changed files with 18 additions and 1 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace FilterLists.Services.FilterList
@ -7,6 +8,7 @@ namespace FilterLists.Services.FilterList
public class ListSummaryDto
{
public int Id { get; set; }
public DateTime CreatedDateUtc { get; set; }
public IEnumerable<ListLanguagesDto> Languages { get; set; }
public string Name { get; set; }
public string ViewUrl { get; set; }

View file

@ -4,6 +4,7 @@ import "isomorphic-fetch";
import ReactTable from "react-table"
import "react-table/react-table.css"
import ListDetails from "./ListDetails";
import * as moment from "moment";
interface IHomeState {
lists: IListDto[];
@ -92,6 +93,19 @@ export class Home extends React.Component<RouteComponentProps<{}>, IHomeState> {
headerClassName: "d-none d-sm-block",
className: "d-none d-sm-block"
},
{
Header: "Added",
accessor: "createdDateUtc",
filterable: true,
filterMethod: (filter: any, row: any) => row[filter.id].toUpperCase()
.includes(filter.value.toUpperCase()),
sortMethod: (a: any, b: any) => a.join().toUpperCase() > b.join().toUpperCase() ? 1 : -1,
Cell: (cell: any) => <div>{moment(cell.value).format("M-D-Y")}</div>,
style: { whiteSpace: "inherit" },
width: 60,
headerClassName: "d-none d-sm-block",
className: "d-none d-sm-block"
},
{
Header: "Details",
accessor: "id",
@ -134,6 +148,7 @@ export class Home extends React.Component<RouteComponentProps<{}>, IHomeState> {
interface IListDto {
id: number;
createdDateUtc: string;
name: string;
languages: IListLanguageDto[];
viewUrl: string;