Git Product home page Git Product logo

clock-tz.js's Introduction

clock-tz.js

Clock widget/plugin with timezone options without jQuery. If you want show time in your timezone or show

Installation:

npm i clock-tz

Usage

In html:

<!-- Date & Time container you can styling anything -->
<div>
    <span id="date"></span>
    <span id="month"></span>
    <span id="year"></span>
    
    <span id="hours"></span>:<span id="minutes"></span>:<span id="seconds"></span>
</div>

<script src="clock.min.js"></script>
<script src="script.js"></script>

In script.js:

// you can set your timezone or any other, or use Clock class without any options by default settings.
const options = {
    timeZoneOffset: +8.00
};
const clock = new Clock(options);
clock.start();

Default settings

Option name Default values Type Description
dateId date string ID html element for day display
monthId month string ID html element for month display
yearId year string ID html element for year display
hoursId hours string ID html element for hours display
minutesId minutes string ID html element for minutes display
secondsId seconds string ID html element for seconds display
timeZoneOffset null float Time zone offset from UTC, example: +8.00 for UTC+8:00
monthNames ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] Array Month names for display. From January to December.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

clock-tz.js's People

Contributors

arsensokolov avatar

Watchers

James Cloos avatar  avatar

Forkers

godofallthatwas

clock-tz.js's Issues

I don't know how to use git...... Sigh....

Heck I don't even know how to use NPM.....

Anyway.... I added super basic AM PM support..... not that I know what I'm doing.... Just wanted to submit it in case you wanted to push or pull it or something into the main code branch......

[
clock.zip

](url)

I may have started a pull request? I don't know..... I keep saying i'll figure out git eventually..... maybe one day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.