I have the following class
where I specify a Date
type for the birtDate
.
When I create an instance of the class, and I fill the date in the following way, this is what I get on the front-end: Sun Jun 17 2012 00:00:00 GMT+0200 (CEST)
I only want the Jun 17 2012
part, so what format should I provide in order to get that ?
The class:
export class Person {
public firstname: String;
public lastname: String;
public birthDate: Date;
public area: String;
public rating: number[];
}
An instance of the class:
{
firstname: 'Elin',
lastname: 'Skuladottir',
birthDate: new Date(2012, 5, 17),
area: 'Greater Copenhagen',
rating: []
}