|
|
@@ -24,6 +24,21 @@ $(function() {
|
|
|
initialiseLocations();
|
|
|
});
|
|
|
|
|
|
+ $("#date-range").daterangepicker({
|
|
|
+ locale: {
|
|
|
+ format: "DD/MM/YYYY"
|
|
|
+ }
|
|
|
+ }, function(start, end, label) {
|
|
|
+
|
|
|
+ var startValue = start.format('YYYY-MM-DD');
|
|
|
+ var endValue = end.format('YYYY-MM-DD');
|
|
|
+
|
|
|
+ $("#date-start").val(startValue);
|
|
|
+ $("#date-end").val(endValue);
|
|
|
+
|
|
|
+ initialiseLocations();
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
|
|
|
function initialiseAddresses() {
|
|
|
@@ -83,7 +98,9 @@ function initialiseLocations() {
|
|
|
let map = maps["nearby-locations-map"];
|
|
|
|
|
|
$.get("/api/users/" + userId + "/get-locations", {
|
|
|
- "address_id": $("#address-id").val()
|
|
|
+ "address_id": $("#address-id").val(),
|
|
|
+ "date_start": $("#date-start").val(),
|
|
|
+ "date_end": $("#date-end").val()
|
|
|
}, function(response) {
|
|
|
if(!response.success) return false;
|
|
|
if(!response.locations) return false;
|