function Trails(data) {
    this.name = data.name;
    this.location = data.location;
    this.lenght = data.length;
    this.stars = data.stars;
    this.star_votes = data.starVotes;
    this.summary = data.summary;
    this.trail_url = data.url;
    this.conditions = data.conditionDetails;
    let day = new Date(data.conditionDate);
    this.condition_date = day.toLocaleDateString();
    this.condition_time = day.toLocaleTimeString("en-US");
}
// constructor function formate the location responed data
constructor function formate the location responed data
constructor function formate the location responed data
function Trails(data) {
    this.name = data.name;
    this.location = data.location;
    this.lenght = data.length;
    this.stars = data.stars;
    this.star_votes = data.starVotes;
    this.summary = data.summary;
    this.trail_url = data.url;
    this.conditions = data.conditionDetails;
    let day = new Date(data.conditionDate);
    this.condition_date = day.toLocaleDateString();
    this.condition_time = day.toLocaleTimeString("en-US");
}
function Trails ( data ) { this . name = data . name ; this . location = data . location ; this . lenght = data . length ; this . stars = data . stars ; this . star_votes = data . starVotes ; this . summary = data . summary ; this . trail_url = data . url ; this . conditions = data . conditionDetails ; let day = new Date ( data . conditionDate ) ; this . condition_date = day . toLocaleDateString ( ) ; this . condition_time = day . toLocaleTimeString ( "en-US" ) ; }
constructor function formate the location responed data
constructor function formate the location responed data