@@ -8,6 +8,7 @@ import org.json4s.JInt
88import org .json4s .JArray
99import org .json4s .JsonDSL ._
1010import org .joda .time .DateTime
11+ import org .joda .time .DateTimeZone
1112
1213import codecheck .github .utils .ToDo
1314
@@ -77,7 +78,7 @@ case class IssueListOption(
7778) {
7879 def q = s " ?filter= $filter&state= $state&sort= $sort&direction= $direction" +
7980 (if (! labels.isEmpty) " &labels=" + labels.mkString(" ," ) else " " ) +
80- ( if ( ! since.isEmpty) (since map (" &since=" + _.toString(" yyyy-MM-dd'T'HH:mm:ss'Z'" ))).get else " " )
81+ since.map(" &since=" + _.toDateTime( DateTimeZone . UTC ). toString(" yyyy-MM-dd'T'HH:mm:ss'Z'" )).getOrElse( " " )
8182}
8283
8384case class IssueListOption4Repository (
@@ -91,15 +92,13 @@ case class IssueListOption4Repository(
9192 direction : SortDirection = SortDirection .desc,
9293 since : Option [DateTime ] = None
9394) {
94- def q = " ? " + ( if ( ! milestone.isEmpty) (milestone map (t => s " milestone= $t & " )).get else " " ) +
95- s " state= $state " +
96- ( if ( ! assignee.isEmpty) (assignee map (t => s " &assignee= $t" )).get else " " ) +
97- ( if ( ! creator.isEmpty) (creator map (t => s " &creator= $t" )).get else " " ) +
98- ( if ( ! mentioned.isEmpty) (mentioned map (t => s " &mentioned= $t" )).get else " " ) +
95+ def q = s " ?state= $state &sort= $sort &direction= $direction " +
96+ milestone.map(t => s " milestone= $t & " ).getOrElse( " " ) +
97+ assignee.map(t => s " &assignee= $t" ).getOrElse( " " ) +
98+ creator.map(t => s " &creator= $t" ).getOrElse( " " ) +
99+ mentioned.map(t => s " &mentioned= $t" ).getOrElse( " " ) +
99100 (if (! labels.isEmpty) " &labels=" + labels.mkString(" ," ) else " " ) +
100- s " &sort= $sort" +
101- s " &direction= $direction" +
102- (if (! since.isEmpty) (since map (" &since=" + _.toString(" yyyy-MM-dd'T'HH:mm:ss'Z'" ))).get else " " )
101+ since.map(" &since=" + _.toDateTime(DateTimeZone .UTC ).toString(" yyyy-MM-dd'T'HH:mm:ss'Z'" )).getOrElse(" " )
103102 }
104103
105104case class IssueInput (
0 commit comments