I am in the middle doing some test data for my views before making API calls to an API application.
In a service in my angular 2 application, I created an interface that looks like this:
export interface amendmentBookings {
bookingNumber: string;
outboundDate: Date;
returnDate: Date;
route: string;
Passengers: string;
vehicleType: string;
}
I also created an array, which should consist of a type of this interface. The code is as follows:
var bookings: amendmentBookings[] = [
{
bookingNumber: "123456789",
outboundDate:
returnDate:
route: "Dünkirchen - Dover",
vehicleType: "Car 1.85m x 4.5m",
Passengers: "1 adult and 1 child"
},
]
How can I insert a date in my test data?
I tried using the new Date () you are using in javascript, for example:
new Date("February 4, 2016 10:13:00");
But that does not work.
source
share