I am currently trying to figure out how to calculate the difference in days between a date pulled through from an API and today's date.
this is the code I have used to get todays date in the format that matches date from the API:
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
today = dd + '/' + mm + '/' + yyyy;
This twig code pulls the date of the API through
{{ job.date }}
What I need to work out to do and struggling with is
today - {{ job.date }} = Difference in Days
I have looked through the articles here but I have struggled to find one that I can understand.
Could this be done with twig?
Any help would be appreciated and even more so if someone could put the snippet together for me.