Creating a template filter to show how many days have passed since a post was published

When talking about creation or modification dates, it is convenient to read a more human-readable time difference—for example, the blog entry was posted 3 days ago, the news article was published today, and the user last logged in yesterday. In this recipe, we will create a template filter named date_since, which converts dates to humanized time differences based on days, weeks, months, or years.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset