Skip to content

Instantly share code, notes, and snippets.

@felixhaeberle
Created January 24, 2020 00:11
Show Gist options
  • Select an option

  • Save felixhaeberle/304632124bf7e1a4b38c817a1c50501a to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

mkraha commented Mar 2, 2021

Thank you for this.

@felixhaeberle
Copy link
Copy Markdown
Author

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

@flacorojitas
Copy link
Copy Markdown

Very useful. Thanks

@ikunyemingor
Copy link
Copy Markdown

Thanks that was helpful.

@deliooos
Copy link
Copy Markdown

deliooos commented Mar 5, 2022

Thank you :)

@taydmgch190016
Copy link
Copy Markdown

nice! Thanks.

@benkimdev
Copy link
Copy Markdown

Thank you very much! 🚀

@asterion
Copy link
Copy Markdown

👍

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