Skip to content

Instantly share code, notes, and snippets.

@doug-wade
Created August 16, 2016 22:37
Show Gist options
  • Save doug-wade/05a7dc08c2bed668a217c2f5c9ada8d2 to your computer and use it in GitHub Desktop.
Save doug-wade/05a7dc08c2bed668a217c2f5c9ada8d2 to your computer and use it in GitHub Desktop.
export default class LocalDate {
constructor (day, month, year) {
this.year = year;
this.month = month;
this.day = day;
}
toCompatString() {
return `${this.year}-${this.month}-${this.day}T00:00`;
}
toDate() {
return new Date(this.year, this.month, this.day);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment