0

image of the response datahere is another image I was able to get the result from an API using request.

API

https://jobs.search.gov/jobs/search.json?query=nursing+jobs

What i want to know is how to filter data from json array

how would i filter it using date? for example i want to filter and show data which start_date is only == today, start_date of this week , and/or and start_date of this month. that the data that will show was based on the date filtered.

i want to know how to filter the data using the date in json like "date:" "1/01/18", by just using date data from json.

the controller

function AppController($scope, TestFactory) {
    /* console.log("AppController is now available.");*/
   /* var testdata = {};*/
    $scope.testdata = [];
    TestFactory.getData().then(function(response) {
    $scope.testdata = response.data;

          console.log("Data:",$scope.testdata);
    })
the service
function TestFactory($http) {

    return {
      getData: getData
    };

    function getData() {
      return $http.get('https://jobs.search.gov/jobs/search.json?query=nursing+jobs').then(function(response) {
        return response;
      }, function(error) {
        return error;
      });
    }
  };

the front

<ion-slides options="options_day" slider="slider_day">
            <ion-slide-page ng-repeat="event in suncorpdata">
              <div class="now-viewport">
                <div class="event-image">
                  <!-- <img ng-src="{{ event.image }}"> -->
                </div>
                <div class="event-placeholder">
                  <div class="event-title">{{event.id}}</div>
                  <div class="event-details">
                    <div>{{ event.position_title }}</div>
                    <div>{{ event.organization_name }}</div>
                    <div>{{ event.start_date }}</div>
                  </div>
                </div>
              </div>
            </ion-slide-page>
Jhon Caylog
  • 483
  • 8
  • 24

0 Answers0