views:

28

answers:

1

Hi guys,

I'm looking for a (ideally jQuery plugin) Javascript library that will let me provide datetimes formatted in whatever standard format (ISO 8601 seems to be the most commonly used among libraries that do something similar, like timeago and Prettydate), and have them transformed into strings like:

  • Wednesday, 5:00pm
  • Tomorrow, 9:00am
  • Saturday, 11:00pm

etc.

Timezone offsets are not a concern, since the event entities (the time of which I want to pretty print like above) are only shown to a user if they are sufficiently geographically close (within a single timezone).

Any ideas? Any and all help is appreciated! :)

+2  A: 

Take a look at Datejs

Datejs is an open-source JavaScript Date Library.

Comprehensive, yet simple, stealthy and fast. Datejs has passed all trials and is ready to strike. Datejs doesn’t just parse strings, it slices them cleanly in two.

The API is clean and easy to understand, and it just works.

roosteronacid
@roosteronacid This looks like exactly what I need - much obliged! :)
ubermensch
You're welcome :)
roosteronacid