2

Is it possible to activate the following Twig extension from within a craft plugin:

http://twig.sensiolabs.org/doc/extensions/date.html

2
  • If the time_diff filter is all you need, then maybe it's worth looking into this Craft plugin with similar functionality: "Time Ago In Words".
    – carlcs
    Feb 18 '15 at 12:16
  • How did I miss that?! Perfect, I will need to extend functionality a tad as I also need to return the actual difference values in years, months and days too. Feb 18 '15 at 12:22
1

The Twig extension package is not included with your Craft install. So you need to download it and add it to your Craft plugin manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.