@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow revisions to be filtered by created date

Summary:
Ref T13202. See PHI906. This is a reasonable capability which we support in some other applications already.

(The only real reason not to support this is that it creates some clutter in the UI, but I think we're generally in better shape now than we were in the past, and we could make this UI collapse/fold at some point.)

Test Plan: Ran queries with a minimum date, a maximum date, both, and neither. Saw appropriate results in all cases.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13202

Differential Revision: https://secure.phabricator.com/D19732

+38
+22
src/applications/differential/query/DifferentialRevisionQuery.php
··· 25 25 private $updatedEpochMax; 26 26 private $statuses; 27 27 private $isOpen; 28 + private $createdEpochMin; 29 + private $createdEpochMax; 28 30 29 31 const ORDER_MODIFIED = 'order-modified'; 30 32 const ORDER_CREATED = 'order-created'; ··· 203 205 public function withUpdatedEpochBetween($min, $max) { 204 206 $this->updatedEpochMin = $min; 205 207 $this->updatedEpochMax = $max; 208 + return $this; 209 + } 210 + 211 + public function withCreatedEpochBetween($min, $max) { 212 + $this->createdEpochMin = $min; 213 + $this->createdEpochMax = $max; 206 214 return $this; 207 215 } 208 216 ··· 685 693 $conn_r, 686 694 'r.dateModified <= %d', 687 695 $this->updatedEpochMax); 696 + } 697 + 698 + if ($this->createdEpochMin !== null) { 699 + $where[] = qsprintf( 700 + $conn_r, 701 + 'r.dateCreated >= %d', 702 + $this->createdEpochMin); 703 + } 704 + 705 + if ($this->createdEpochMax !== null) { 706 + $where[] = qsprintf( 707 + $conn_r, 708 + 'r.dateCreated <= %d', 709 + $this->createdEpochMax); 688 710 } 689 711 690 712 if ($this->statuses !== null) {
+16
src/applications/differential/query/DifferentialRevisionSearchEngine.php
··· 45 45 $query->withStatuses($map['statuses']); 46 46 } 47 47 48 + if ($map['createdStart'] || $map['createdEnd']) { 49 + $query->withCreatedEpochBetween( 50 + $map['createdStart'], 51 + $map['createdEnd']); 52 + } 53 + 48 54 return $query; 49 55 } 50 56 ··· 84 90 ->setDatasource(new DifferentialRevisionStatusFunctionDatasource()) 85 91 ->setDescription( 86 92 pht('Find revisions with particular statuses.')), 93 + id(new PhabricatorSearchDateField()) 94 + ->setLabel(pht('Created After')) 95 + ->setKey('createdStart') 96 + ->setDescription( 97 + pht('Find revisions created at or after a particular time.')), 98 + id(new PhabricatorSearchDateField()) 99 + ->setLabel(pht('Created Before')) 100 + ->setKey('createdEnd') 101 + ->setDescription( 102 + pht('Find revisions created at or before a particular time.')), 87 103 ); 88 104 } 89 105