@@ -504,6 +504,7 @@ extension CustomPostListViewModel {
504504
505505struct CustomPostCollectionDisplayPost : Equatable {
506506 let date : Date
507+ let modifiedDate : Date ?
507508 let title : String ?
508509 let content : String ?
509510 let authorName : String ?
@@ -515,6 +516,7 @@ struct CustomPostCollectionDisplayPost: Equatable {
515516
516517 init (
517518 date: Date ,
519+ modifiedDate: Date ? = nil ,
518520 title: String ? ,
519521 content: String ? ,
520522 authorName: String ? = nil ,
@@ -525,6 +527,7 @@ struct CustomPostCollectionDisplayPost: Equatable {
525527 isHomepage: Bool = false
526528 ) {
527529 self . date = date
530+ self . modifiedDate = modifiedDate
528531 self . title = title
529532 self . content = content
530533 self . authorName = authorName
@@ -537,6 +540,7 @@ struct CustomPostCollectionDisplayPost: Equatable {
537540
538541 init ( _ entity: AnyPostWithEditContext , blog: Blog , primaryStatus: PostStatus = . publish) {
539542 self . date = entity. dateGmt
543+ self . modifiedDate = entity. modifiedGmt
540544 self . title = entity. title? . raw
541545 let contentPreview = GutenbergExcerptGenerator
542546 . firstParagraph ( from: entity. content. rendered)
@@ -582,10 +586,18 @@ struct CustomPostCollectionDisplayPost: Equatable {
582586 }
583587
584588 private var dateForDisplay : String {
585- if status == . future {
586- return date. formatted ( date: . abbreviated, time: . shortened)
589+ let string : String
590+ switch status {
591+ case . future:
592+ string = date. mediumStringWithTime ( )
593+ case . publish, . private:
594+ string = date. toMediumString ( )
595+ case . trash:
596+ string = ( modifiedDate ?? date) . toMediumString ( )
597+ default :
598+ string = ( modifiedDate ?? date) . toMediumString ( )
587599 }
588- return date . formatted ( date : . abbreviated , time : . omitted )
600+ return string . capitalized ( with : . current )
589601 }
590602
591603 /// Combined status badges (e.g. "Private · Sticky") matching the regular
0 commit comments