I whould like to get 2 variables. 1 with the current date (yyyy-MM-DD), and 1 with the date of tomorrow (yyyy-MM-DD).
I need to place these 2 variables in my HTTP request. Can someone show me how I can make the 2 variables and use them in my HTTP request. The current code behind is this:
export class BookingService {
private config: Object;
public today = new Date();
public tomorrow = new Date();
public domainSettings: Object = {};
constructor(
private http: Http,
private kioskservice: KioskService
) { }
public getAllBookings() {
return new Promise((resolve, reject) => {
this.http
.get(
`${this.kioskservice.getAPIUrl()}search/dashboard/${this.kioskservice.LocationGUID()}/?apikey=${this.kioskservice.getAPIKey()}&format=json&from=2018-04-17&until=2018-04-18&full=true`
)
.toPromise()
.then(
res => {
this.config = res.json()
console.log(res.json());
resolve();
},
msg => {
throw new Error("Couldn't get all Bookings: " + msg);
}
);
});
}
}