Currently, I am in the process of generating test data for my views before initiating API calls to the API application.
Within a service in my Angular 2 application, I have defined an interface as follows:
export interface amendmentBookings {
bookingNumber: string;
outboundDate: Date;
returnDate: Date;
route: string;
Passengers: string;
vehicleType: string;
}
Moreover, I have initialized an array that must adhere to this interface's structure. Here is the code snippet:
var bookings: amendmentBookings[] = [
{
bookingNumber: "123456789",
outboundDate:
returnDate:
route: "Dünkirchen - Dover",
vehicleType: "Car 1.85m x 4.5m",
Passengers: "1 adult and 1 child"
},
]
I am facing an issue with inserting a date into my test data. I attempted using the javascript `new Date()` method like so:
new Date("February 4, 2016 10:13:00");
Unfortunately, this approach does not seem to be working for me...