Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save samueleresca/589b0f440e1a84d0ba66 to your computer and use it in GitHub Desktop.
Save samueleresca/589b0f440e1a84d0ba66 to your computer and use it in GitHub Desktop.
class Ticket {
private _id: string;
private _enterDate: Date;
private _exitDate: Date;
constructor(parking_lot: string) {
this._id = parking_lot + "-" + ((new Date()).getTime().toString());
this._enterDate = new Date(); //GET CURRENT DATE
this._exitDate = null;
}
get Id() { return this._id; }
get EnterDate() { return this._enterDate; }
set EnterDate(date: Date) { this._enterDate = date; }
get ExitDate() { return this._exitDate; }
set ExitDate(date: Date) { this._exitDate = date; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment