I have a Scala class that follows:
case class Game(id: Option[String], ....... start: Option[java.sql.Timestamp], end: Option[java.sql.Timestamp], ..)
This class is used by slick to save the games objects into the DB. Start and End are used to represent when they started and ended. There is also a Games class that works like the plural for Game.
I created a method that looks like
def getAllGamesBetween(iniDate: Option[String], endDate:Option[String]) = Action.async { request =>
for {
lGames <- Games.getAll(g => iniDate.get < Timestamp.valueOf(g.start) && Timestamp.valueOf(g.start) < endDate)
} yield {
Ok(.....);
}
}
The problem I have is that I need to understand how to harmonize the values obtained through iniDate:Option[String] and endDate:Option[String] and their respective field values
start: Option[java.sql.Timestamp]
end: Option[java.sql.Timestamp]
so I can make comparisons and see, for example, which one is before another or after another.
One more thing, iniDate and endDate will get Option[string] values that follow the format: Option["YYYY-MM-DD hh:mm:ss"]. Similarly the values for start and end are stored in the DB as "YYYY-MM-DD hh:mm:ss"