https://github.com/marinko-peso/time-now-custom-element
:clock1: Show updated current time in an html element. Date and time will automatically refresh every second.
https://github.com/marinko-peso/time-now-custom-element
Last synced: about 1 month ago
JSON representation
:clock1: Show updated current time in an html element. Date and time will automatically refresh every second.
- Host: GitHub
- URL: https://github.com/marinko-peso/time-now-custom-element
- Owner: marinko-peso
- License: mit
- Created: 2018-10-06T21:45:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T06:27:47.000Z (over 6 years ago)
- Last Synced: 2025-03-16T20:06:57.915Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# time-now-custom-element
[](https://github.com/ellerbrock/open-source-badges/)
[](https://github.com/marinko-peso/time-now-custom-element/blob/master/LICENSE)
[](https://github.com/Flet/semistandard)
[](https://npm.im/time-now-custom-element)
[](https://packagephobia.now.sh/result?p=time-now-custom-element)
[](https://david-dm.org/marinko-peso/time-now-custom-element)🕐 Show updated current time in an html element. Date and time will automatically refresh every second.
Demo available [here](https://htmlpreview.github.io/?https://github.com/marinko-peso/time-now-custom-element/blob/master/demo/index.html).
## Install
Available via npm:
```npm i time-now-custom-element```## Usage
Install via npm or include the ```now-element.js``` in your html page and simply add `````` element.
```format``` propery is optional with following rules:
- ```Y```: year number (example: 2018)
- ```M```: month number (example: 09)
- ```B```: month name (example: September)
- ```D```: day number (example: 2)
- ```C```: day name (example: Tuesday)
- ```h```: hours number (example: 23)
- ```m```: minutes number (example: 55)
- ```s```: seconds number (example:12)Default format: ```Y-M-D h:m:s``` which yields: ```2018-09-07-Sunday 01:42:34```
## License
MIT.