Skip to content

Instantly share code, notes, and snippets.

@felixhaeberle
Created January 24, 2020 00:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save felixhaeberle/304632124bf7e1a4b38c817a1c50501a to your computer and use it in GitHub Desktop.
Save felixhaeberle/304632124bf7e1a4b38c817a1c50501a to your computer and use it in GitHub Desktop.
Twig calculate age based on birthday date
{% set age = date().diff(date(item.birthday)).y %}
@mkraha
Copy link

mkraha commented Mar 2, 2021

Thank you for this.

@felixhaeberle
Copy link
Author

You're welcome! I'm happy that it helps someone. 🥳

@flacorojitas
Copy link

Very useful. Thanks

@ikunyemingor
Copy link

Thanks that was helpful.

@deliooos
Copy link

deliooos commented Mar 5, 2022

Thank you :)

@taydmgch190016
Copy link

nice! Thanks.

@h0chi-dev
Copy link

Thank you very much! 🚀

@asterion
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment