4747import org .labkey .targetedms .query .ReplicateManager ;
4848
4949import java .nio .file .Path ;
50- import java .text .DateFormat ;
51- import java .text .ParseException ;
5250import java .util .ArrayList ;
5351import java .util .Arrays ;
5452import java .util .Collections ;
@@ -122,7 +120,7 @@ public List<SampleFileInfo> getSampleFiles(Container container, User user, Integ
122120 }
123121
124122 @ Override
125- public List <SampleFileInfo > getSampleFiles (Container container , User user , Date startDate , Date endDate )
123+ public List <SampleFileInfo > getSampleFiles (@ NotNull Container container , @ NotNull User user , @ Nullable Date startDate , @ Nullable Date endDate )
126124 {
127125 List <SampleFileInfo > sampleFileInfos = TargetedMSManager .get ().getSampleFileInfos (container , user , null );
128126 List <SampleFileInfo > result = new ArrayList <>();
@@ -131,9 +129,9 @@ public List<SampleFileInfo> getSampleFiles(Container container, User user, Date
131129 for (SampleFileInfo sampleFileInfo : sampleFileInfos )
132130 {
133131 Date acquired = DateUtil .getDateOnly (sampleFileInfo .getAcquiredTime ());
134- Date start = DateUtil .getDateOnly (startDate );
135- Date end = DateUtil .getDateOnly (endDate );
136- if ((acquired .after (start ) && acquired . before ( end ) || acquired .compareTo (start ) == 0 || acquired .compareTo (end ) == 0 ))
132+ Date start = startDate == null ? acquired : DateUtil .getDateOnly (startDate );
133+ Date end = endDate == null ? acquired : DateUtil .getDateOnly (endDate );
134+ if ((acquired .after (start ) || acquired .compareTo (start ) == 0 ) && ( acquired . before ( end ) || acquired .compareTo (end ) == 0 ))
137135 {
138136 result .add (sampleFileInfo );
139137 }
0 commit comments