[javascript] How to get start and end of day in Javascript?

This is how we can do it in Java 8 style using LocalDate:

LocalDate localDateStart = LocalDate.now().plusDays(5);
Date startDate = Date.from(localDateStart.atStartOfDay(ZoneId.systemDefault()).toInstant());

LocalDate localDateEnd = localDateStart.plusDays(1);
Date endDate = Date.from(localDateEnd.atStartOfDay(ZoneId.systemDefault()).toInstant());