EE 1
EE 2
JB Friendly

Developer

Joel Bradbury

3rd Party (Free)

6 downloads (last 90 days)

Download

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Entry API
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

Convert date, relative to another to a user friendly format. EE1.x and EE2.x compatible.

Basic usage

My prefered tag usage goes like so:

    {exp:jb_friendly entry_date="{entry_date}"}
         This entry was posted {friendly} {direction}
    {/exp:jb_friendly}

That will generate the date in a friendly format (including handling future/past dates) and wrap the full date in the abbreviation, since (or until) now, and the datetime provided.

If you’d like to do the friendly date between a different period just supply the tag like so:

    {exp:jb_friendly entry_date="{comment_date}" relative_date="{entry_date}"}
        This comment was posted {friendly} after the article
    {/exp:jb_friendly}

Parameters

1) Entry Date

      entry_date="123457890"

    The only required tag. The date you want the time since/until. If none is supplied, the plugin will bail out and return an empty string. Supplied unformated.

2) Relative Date

      relative_date="123457890"

defaults to now

    Optionally calculate the period between the entry date and another time. If none is supplied the system will calulate the period between now and the entry_date.

3) Stop After

      stop_after="1 month"

defaults to “never”

    Because of the wordy nature of the formatting, periods progressivly loose there accuracy the larger they get. Using this tag you can stop the dates turning into words after a set length. The valid options are :
     
o stop_after=“1 day”
o stop_after=“1 week”
o stop_after=“1 month”
o stop_after=“1 year”

    When the period is older than that, the tag friendly will naturally become the full date, formated. (Using the default date formatting style, modifyable via the date_format tag (see next))

    If no stop_after param is supplied, the plugin will keep generating wordy periods for all dates.

4) Default Full Date Format

      format="%d/%m/%y" 

defaults to “%F %d%S, %Y”

    Optionally alter the standard date_format. The default is returns in the form “August 19th, 2010”. Uses the exact same date formatting tags as every other date formatting tag.

Tags


1)    {friendly}

    The date period in friendly words. (English only at the moment).

2)  {direction}

    If the time period is in the past, returns “ago”. If it is in the future “to go”. If the time period is longer than the stop_after paramter supplied, the {direction} will return nothing.

3)    {full_date}

    The entry_date tag in full formated style. ie. “August 19th, 2010”

Download JB Friendly

EE Version Downloads Add-On Version Release Date
1.x Download 1.2 2011-08-15 11:56 AM
2.+ Download 2011-08-15 11:56 AM

JB Friendly Links

This entry was created March 14, 2011, 11:38 am.
This entry was last updated August 15, 2011, 1:57 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

There are no reviews for this add-on yet.

What are you waiting for? Rate it and review it!