<commit_before>package app.model

import org.joda.time.{DateTime, LocalDateTime}

case class ActivePeriod(startHour: Int, finishHour: Int) {
  def includes(now: DateTime) = {
    //TODO: this should systemClock()
    val startOfDay = new DateTime(now.getYear, now.getMonthOfYear, now.getDayOfMonth, 0, 0, 0, 0)
    now.isAfter(startOfDay.plusHours(startHour)) && now.isBefore(startOfDay.plusHours(finishHour))
  }
}<commit_msg>use clock religiously<commit_after>package app.model

import app.ServiceFactory.systemClock
import org.joda.time.{DateTime, LocalDateTime}

case class ActivePeriod(startHour: Int, finishHour: Int) {
  def includes(now: DateTime) = {
    val startOfDay = systemClock().date.toDateTimeAtStartOfDay
    now.isAfter(startOfDay.plusHours(startHour)) && now.isBefore(startOfDay.plusHours(finishHour))
  }
}
{'fraction_non_alphanumeric': 0.1185006045949214, 'fraction_numerical': 0.0048367593712212815, 'mean_word_length': 5.7317073170731705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6071408', 'n_tokens_mistral': 285, 'n_tokens_neox': 279, 'n_words': 53}