I'm using the Scala Play framework and I have a form that lets a user search for records, they can then search using today's date and a time stamp 2016-12-17T09:26:47.676Z
to create a search range. Note that I mean a 24 hour period, as a single day is usually defined, and not as a difference in a date definition.
I don't have any experience with Javascript, I'd like to compare today's date with this time stamp, calculate the difference in days, and then return the amount of whole days
between the two time stamps e.g if the two timestamps had 48 hours difference then it would return 2
days.
I can declare the search time stamp in the script
tag on the HTML page, but I would like to know how to call today's date, do some logic to calculate the difference between the dates DaysDifference
, and then call this variable in a link on the page:
<a target="_blank" href="@baseLogsUrl/#/discover?_g=(time:(from:no@DaysDifference/d,to:now))&_a=(query:(query_string:(query:'@data._id')))">