jQuery Plugin: CuteTime, C’est Magnifique! (v 1.1) [UPDATE]

jquery-logo-256I am very pleased to announce the latest major update to the CuteTime jQuery plugin.

CuteTime provides the ability to easily…

  • convert timestamps to ‘cuter’ language-styled forms (e.g. yesterday, 2 hours ago, last year, in the future!),
  • customize the time scales and output formatting, and
  • update automatically and/or manually the displayed CuteTime(s).
Un-Cute Cute
2010-1-27 23:14:17 a few days ago
Thu, October 29, 2004 12:14:19 PM 5 years ago

Since CuteTime was released last year, there continues to be a flood of excellent feedback from many of you consisting of suggestions, bug reports (less of these), and feature requests (more of these). Much of that feedback has coalesced into this latest major release.

imageAs you may already have been able to tell, this latest update was, in part, inspired by the French language. Perhaps one of the greatest drivers, to whom I am grateful, of a central new feature within this release has been Bruno Morency, through whose guidance and linguistic support I was able to design a more robust, universal CuteTime for all languages and grammatical styles.

In addition to the inclusion of French CuteTime translations within the translations.txt file, this release, version 1.1, features…

  • ISO8601 date timestamp compliance
  • insertions using the %CT% pattern of computed numbers within the CuteTime cuteness
  • support for all foreign language characters and HTML
  • Spanish CuteTime translations, courtesy of Alex Hernandez
  • richer demos and test
  • improved settings flexibility of the CuteTime function
  • documentation updates (corrections and clarifications)

French, et al

Originally, CuteTime was developed with a less than universal syntactic centricity. Basically, CuteTime originally could handle the cuteness of presenting…

“a few seconds ago”
“last month”

…as well as prepend values resulting in…

” hours ago” becoming “4 hours ago”
” seconds ago” becoming “18 seconds ago”.

Now, in addition to supporting the prepending of the computed CuteTime,

  • the calculation can be inserted within the cuteness string, and
  • both formatted HTML styling and proper character accenting applied,

…resulting in the additional support for…

“il y a %CT% minutes” becoming “il y a 4 minutes”
“l\’année dernière” becoming “l’année dernière”
“<span style=’color: red; font-weight: bold’>in the future<span>” becomingin the future

ISO8601

image Formatting of timestamps is the bane of many a developer. Especially onerous is the handling of “standard” time formatting by the front-end developer. The JavaScript Date Object() supports the IETF standard, defined in RFC 822 Section 5, at least in FireFox, with most backend systems providing and storing (or at least converting to) dates in ISO8601 form.

Now, when converting a normal time into a CuteTime it can be either formatted in a manner compatible with the JavaScript Date() Object …

Thu Oct 15 2009 22:11:19 GMT-0400 (Eastern Daylight Time)
Oct 15 2009 22:11:19

… or ISO8601 …

2009-11-24T19:20:30+01:00
2009-11
2009-11-24T13:15:30Z

Implementation

CuteTime is a customizable jQuery plugin that automatically converts timestamps to formats much cuter. It also has the ability to manually and/or automatically update timestamps on a controlled interval.

  • If used by Selector, it replaces the text of the provided object with a CuteTime.
  • If used as a function, it returns a string containing a CuteTime version of the provided timestamp.
$('.timestamp').cuteTime();
$('.timestamp').cuteTime({ /* OPTIONS * / });

cutetime_object = $('.timestamp').cuteTime();
cutetime_object.update_cuteness();

$.cuteTime('2009/10/12 22:11:19');
$.cuteTime({ /* OPTIONS * / }, '2009/10/12 22:11:19'); // [NEW!]

For more details about the latest CuteTime improvements and their implementation, visit http://tpgblog.com/CuteTime

If you find this useful, or have any questions, ideas, or issues, leave a comment.

Enjoy!

Jeremy Horn
The Product Guy

Add to Social Bookmarks: Stumbleupon Del.ico.us Furl Reddit Google Add to Mixx!
This entry was posted in user experience and tagged , , , , , , , , , , , , , by Jeremy Horn. Bookmark the permalink.

About Jeremy Horn

Jeremy Horn is an award-winning, product management veteran with thirteen years of experience leading and managing product teams. Jeremy has held various executive and advisory roles, from founder of several start-ups to driving diverse organizations in online services, consumer products, and social media. As founder of The Product Group, he has created the largest product management meetup in the world and hosts the annual awarding of The Best Product Person. Jeremy can currently be found pioneering the next generation of content management and sharing at Viacom, acting as creator and instructor of the 10-week product management course at General Assembly, and mentoring at Women 2.0 and Lean Startup Machine. Follow Jeremy on twitter @theproductguy or his blog at http://tpgblog.com.

5 thoughts on “jQuery Plugin: CuteTime, C’est Magnifique! (v 1.1) [UPDATE]

  1. Pingback: jQuery Plugin: CuteTime, C'est Magnifique! (v 1.1) [UPDATE] « The … » KHMER855.COM

  2. Pingback: jQuery Plugin: CuteTime, C’est Magnifique! (v 1.1) [UPDATE] « The Product Guy « Netcrema – creme de la social news via digg + delicious + stumpleupon + reddit

  3. Pingback: jQuery Plugin: CuteTime, C'est Magnifique! (v 1.1) [UPDATE] « The … » Code

  4. Pingback: Code List « yourarthere.net

  5. Pingback: The Product Guy: Astonishin’ in 2010! « The Product Guy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s