Skip to content

altfuns/time-element

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<time-ago>

Time elements using Polymer and Moment.js

Demo

Check it live.

Install

Install the component using Bower:

$ bower install time-element --save

Usage

  1. Import Web Components' polyfill:
  <script src="bower_components/platform/platform.js"></script>
  1. Import Custom Element:
  <link rel="import" href="bower_components/time-element/time-ago.html">
  <link rel="import" href="bower_components/time-element/time-format.html">
  1. Start using it!
  <time-ago datetime="2014-09-15 12:05:00" delay="6000" refresh="true"></time-ago>
  <time-format datetime="2014-09-15 12:05:00" format="MMM Do YY"></time-format>

Options

Attribute Options Default Description
datetime string 0000-00-00 00:00:00 Date and time in YYYY-MM-DD HH:mm:ss format
refresh boolean true Auto refresh
delay int 60000 Delay to auto refresh (in milliseconds)

Attribute Options Default Description
datetime string 0000-00-00 00:00:00 Date and time in YYYY-MM-DD HH:mm:ss format
format string YYYY-MM-DD HH:mm:ss Give the format to the result label.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Manteiners

time-ago element create by Bruno Ziiê. time-format element create by Alfonso Aguilar.

History

  • v0.0.1 August 25, 2013
    • Created timeago element
  • v0.0.2 August 26, 2013
    • Add delay attribute
  • v0.0.3 May 23, 2015
    • Add bower structure, dependencies and time-format element.

License

MIT License

About

Timeago element using Polymer and Moment.js

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 100.0%