Skip to content

Commit

Permalink
[Fixes #4964] Date widget has gone (#4969)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Fabiani authored and capooti committed Sep 30, 2019
1 parent 4015623 commit 203ba3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions geonode/static/geonode/js/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,15 +669,19 @@
var init_date = true;
$scope.$watch('date_query', function(){
if($scope.date_query.date__gte != '' && $scope.date_query.date__lte != ''){
$scope.query['date__range'] = $scope.date_query.date__gte + ',' + $scope.date_query.date__lte;
var dateGte = new Date($scope.date_query.date__gte).toISOString();
var dateLte = new Date($scope.date_query.date__lte).toISOString();
$scope.query['date__range'] = dateGte + ',' + dateLte;
delete $scope.query['date__gte'];
delete $scope.query['date__lte'];
}else if ($scope.date_query.date__gte != ''){
$scope.query['date__gte'] = $scope.date_query.date__gte;
var dateGte = new Date($scope.date_query.date__gte).toISOString();
$scope.query['date__gte'] = dateGte;
delete $scope.query['date__range'];
delete $scope.query['date__lte'];
}else if ($scope.date_query.date__lte != ''){
$scope.query['date__lte'] = $scope.date_query.date__lte;
var dateLte = new Date($scope.date_query.date__lte).toISOString();
$scope.query['date__lte'] = dateLte;
delete $scope.query['date__range'];
delete $scope.query['date__gte'];
}else{
Expand Down
3 changes: 3 additions & 0 deletions geonode/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ <h4 class="modal-title" id="myModalLabel">{% trans "Sign in" %}</h4>
$('#search').submit();
}
});
$(".datepicker").datepicker({
format: "yyyy-mm-dd"
});
</script>
<script>
// Workaround to fix the autocomplete box positions
Expand Down

0 comments on commit 203ba3d

Please sign in to comment.