Skip to content

Instantly share code, notes, and snippets.

View xf0e's full-sized avatar
💭
writing comments for compiler...

xf0e

💭
writing comments for compiler...
View GitHub Profile
@vozerov
vozerov / gist:c3578e727e511cd99fd7e9af3e348e14
Created February 15, 2019 11:05
Calculate working interval between 2 timestamps in elasticsearch
// constants
// holidays or vacations, date format must be the same
Set HOLIDAYS = new HashSet(['02.02.2019', '03.02.2019']);
// date format need by date check
def SIMPLE_DATE_FORMAT = new SimpleDateFormat('dd.MM.YYYY');
// time/date constants
long DAY = 24 * 60 * 60 * 1000, HOUR = 60 * 60 * 1000;