diff --git a/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs b/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs index 6eb53c0af..716ce9199 100644 --- a/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs +++ b/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs @@ -23,7 +23,16 @@ public ListDetailsDtoMappingProfile() => .SnapshotRules .Count : 0)) - .ForMember(d => d.UpdatedDate, o => o.MapFrom(l => l.ModifiedDateUtc)) + .ForMember(d => d.UpdatedDate, + o => o.MapFrom(l => + l.Snapshots + .Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2 + ? l.Snapshots + .Where(s => s.WasSuccessful && s.Md5Checksum != null) + .Select(s => s.CreatedDateUtc) + .OrderByDescending(c => c) + .FirstOrDefault() + : null)) .ForMember(d => d.ViewUrl, o => o.MapFrom(l => l.Snapshots diff --git a/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs b/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs index 6213d841d..648456576 100644 --- a/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs +++ b/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs @@ -12,7 +12,16 @@ public ListSummaryDtoMappingProfile() => CreateMap() .ForMember(d => d.Languages, o => o.MapFrom(l => l.FilterListLanguages.Select(la => la.Language))) .ForMember(d => d.Tags, o => o.MapFrom(l => l.FilterListTags.Select(m => m.Tag))) - .ForMember(d => d.UpdatedDate, o => o.MapFrom(l => l.ModifiedDateUtc)) + .ForMember(d => d.UpdatedDate, + o => o.MapFrom(l => + l.Snapshots + .Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2 + ? l.Snapshots + .Where(s => s.WasSuccessful && s.Md5Checksum != null) + .Select(s => s.CreatedDateUtc) + .OrderByDescending(c => c) + .FirstOrDefault() + : null)) .ForMember(d => d.ViewUrl, o => o.MapFrom(l => l.Snapshots diff --git a/src/FilterLists.Web/ClientApp/components/Home.tsx b/src/FilterLists.Web/ClientApp/components/Home.tsx index 5777cb580..4a05efd08 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -122,22 +122,22 @@ export class Home extends React.Component, IHomeState> { headerClassName: "d-none d-md-block", className: "d-none d-md-block" }, - //{ - // Header: "Updated", - // accessor: "updatedDate", - // filterable: true, - // filterMethod: (filter: any, row: any) => row[filter.id].includes(filter.value), - // sortMethod: (a: any, b: any) => moment(a).isValid() - // ? (moment(b).isValid() ? (moment(a).isBefore(b) ? -1 : 1) : 1) - // : -1, - // Cell: (cell: any) =>
{moment(cell.value).isValid() - // ? moment(cell.value).format("l") - // : "N/A"}
, - // style: { whiteSpace: "inherit" }, - // width: 100, - // headerClassName: "d-none d-md-block", - // className: "d-none d-md-block" - //}, + { + Header: "Updated", + accessor: "updatedDate", + filterable: true, + filterMethod: (filter: any, row: any) => row[filter.id].includes(filter.value), + sortMethod: (a: any, b: any) => moment(a).isValid() + ? (moment(b).isValid() ? (moment(a).isBefore(b) ? -1 : 1) : 1) + : -1, + Cell: (cell: any) =>
{moment(cell.value).isValid() + ? moment(cell.value).fromNow() + : "N/A"}
, + style: { whiteSpace: "inherit" }, + width: 100, + headerClassName: "d-none d-md-block", + className: "d-none d-md-block" + }, { Header: "Details", accessor: "id", diff --git a/src/FilterLists.Web/ClientApp/components/ListDetails.tsx b/src/FilterLists.Web/ClientApp/components/ListDetails.tsx index 369214b6d..738a533a1 100644 --- a/src/FilterLists.Web/ClientApp/components/ListDetails.tsx +++ b/src/FilterLists.Web/ClientApp/components/ListDetails.tsx @@ -66,7 +66,7 @@ function ListInfo(props: any) { - { /* --> */ } + @@ -141,8 +141,8 @@ function DiscontinuedDate(props: any) { function UpdatedDate(props: any) { return props.date - ?
  • -

    Last Updated by Maintainer: {moment(props.date).format("l")}

    + ?
  • +

    Last Updated: {moment(props.date).isValid() ? moment(props.date).fromNow() : "N/A"}

  • : null; }