Skip to content

Instantly share code, notes, and snippets.

@pekkis
Created June 21, 2018 05:38
Show Gist options
  • Save pekkis/dc6507d0ebf115e9b289fc66024ea646 to your computer and use it in GitHub Desktop.
Save pekkis/dc6507d0ebf115e9b289fc66024ea646 to your computer and use it in GitHub Desktop.
server/src/services/raw/person.js
// 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