better-prettydate

Enhaces time element to update in realtime


Keywords
better-dom
License
MIT
Install
bower install better-prettydate

Documentation

better-prettydate Build Status Coverage Status

Enhances .prettydate element to update text in realtime

Strings like "an hour ago", "X minutes ago" etc. became to be a standard solution for some UI elements. This project aims to solve adding support for such kind of extension by enhancing elements with the prettydate class in HTML markup.

VIEW DEMO

Installing

Use bower to download this extension with all required dependencies.

bower install better-prettydate

This will clone the latest version of the better-prettydate into the bower_components directory at the root of your project.

Then append the following html elements on your page:

<html>
<head>
    ...
    <!--[if IE]>
        <link href="bower_components/better-dom/dist/better-dom-legacy.htc" rel="htc"/>
        <script src="bower_components/better-dom/dist/better-dom-legacy.js"></script>
    <![endif]-->
</head>
<body>
    ...
    <script src="bower_components/better-dom/dist/better-dom.js"></script>
    <script src="bower_components/better-prettydate/dist/better-prettydate.js"></script>
</body>
</html>

Browser support

Desktop

  • Chrome
  • Safari 6.0+
  • Firefox 16+
  • Opera 12.10+
  • IE8+

Mobile

  • iOS Safari 6+
  • Android 2.3+
  • Chrome for Android