Created
August 16, 2016 22:37
-
-
Save doug-wade/05a7dc08c2bed668a217c2f5c9ada8d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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