def isTargetingDate()

in src/main/scala/com/gu/commercial/branding/SponsorshipHelper.scala [13:20]


  def isTargetingDate(sponsorship: Sponsorship, publishedDate: Option[CapiDateTime]): Boolean = {
    val dateLaterThanThreshold = for {
      targeting <- sponsorship.targeting
      threshold <- targeting.publishedSince
      date <- publishedDate
    } yield date.dateTime >= threshold.dateTime
    dateLaterThanThreshold getOrElse true
  }