Date Time Functions


I have an object in Algolia like -

“startDate”: “2013-09-26T00:00:00.000+05:30”,
“endDate”: “2017-10-25T10:08:44.000+05:30”,


Now, while retrieving the object i want to add another field as -
“endingIn”: “Ending in 9 days”

“endingIn” is days remaining from todays date till endDate. Example:
val daysLeft = Days.daysBetween(, DateTime.parse(endDate)).getDays
val endingIn = s"Ending In $daysLeft days"

Is it possible? Please help!!!

Thanks in advance.

This is definitely doable. You didn’t tag your question however, which front-end solution are you using?

Thanks for your reply. I am using AngularJS in front-end.

Thanks for your answer, and sorry for not being more specific in my question.
Which Algolia-related library are you using? autocomplete.js, instantsearch.js, another one?

A code sample of your current usage of Algolia would be helpful. :slight_smile:

Thanks for replying… I got it resolved with java date-time formatter and writing a function for the same.

Great news! Let us know if we can help you more in any way.