Created
June 21, 2018 05:38
-
-
Save pekkis/dc6507d0ebf115e9b289fc66024ea646 to your computer and use it in GitHub Desktop.
server/src/services/raw/person.js
This file contains hidden or 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
// this one goes to the personService--createPerson | |
get age() { | |
const d = DateTime.fromJSDate(this.birthDay); | |
const now = DateTime.local(); | |
var diff = now.diff(d, "years").toObject(); | |
return diff.years; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment