We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Friendly Date

Development and Programming

avroo's avatar
avroo
164 posts
16 years ago
avroo's avatar avroo

For one of my websites I needed to convert all dates to a nice, readable and user friendly format like: 2 hours ago, 1 month ago, 24 days ago etc.

Butttt, I didn’t want all my dates converted. Only dates between the current time and 1 year old. Couldn’t find one, so I built it myself.

Quick usage:

{exp:friendly_date stop_after="1 year" format="%m/%d/%y %H:%i"}{comment_date}{/exp:friendly_date}

This example will convert all comment dates from the last year. Comments with older dates will be displayed according the format argument.

See the plugin usage for more options!

Feedback is always appreciated.

EDIT Small fix in 1.1 :

  • added dutch language
  • replaced $LOC->now with $LOC->set_localized_time, so current timezone is fixed
       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi,

Nice addition to the pool of EE add-ons.

One suggestion:

I think you should change the name of your plugin because there already exist the plugin with almost the same name - WI Friendlee Date.

       
avroo's avatar
avroo
164 posts
16 years ago
avroo's avatar avroo

well, I could change it, but the names are different…I don’t know any other good name for it! 😊

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Perhaps: Kind Date, or Kindly Date, or Gentle Date, or Helpful Date, or Mild Date, or Tender Date, or Gracious Date, or Cozy Date?

       
Jason Varga's avatar
Jason Varga
26 posts
about 16 years ago
Jason Varga's avatar Jason Varga

Friendlee Date.

Edit: Okay I got excited about posting without actually reading the post… :red:

       
Brian M.'s avatar
Brian M.
529 posts
15 years ago
Brian M.'s avatar Brian M.

Does this work for dates in the future? I.E. 78 days from now? Thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.