Skip to content

Commit

Permalink
#1371 Fix handling duration calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jun 15, 2020
1 parent f694a68 commit 7dfcb18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions thehive/app/org/thp/thehive/controllers/v0/Properties.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.thp.thehive.controllers.v0

import java.util.Date

import scala.collection.JavaConverters._
import scala.util.{Failure, Success, Try}

import play.api.libs.json.{JsNull, JsObject, JsValue, Json}

import gremlin.scala.{__, By, Key, P, Vertex}
import javax.inject.{Inject, Singleton}
import org.scalactic.Accumulation._
Expand Down Expand Up @@ -210,8 +210,8 @@ class Properties @Inject() (
_.select(
_.coalesce(
_.has("endDate")
.sack((_: Long, endDate: Long) => endDate, By(Key[Long]("endDate")))
.sack((_: Long) - (_: Long), By(Key[Long]("startDate")))
.sack((_: Long, endDate: Long) => endDate, By(__.value(Key[Date]("endDate")).map(_.getTime)))
.sack((_: Long) - (_: Long), By(__.value(Key[Date]("startDate")).map(_.getTime)))
.sack((_: Long) / (_: Long), By(__.constant(3600000L)))
.sack[Long](),
_.constant(0L)
Expand Down

0 comments on commit 7dfcb18

Please sign in to comment.