Giter VIP home page Giter VIP logo

dot-beat-time's Introduction

dot-beat-time

dot-beat-time is a small (0.3kb), fast, dependency-free package for getting beat internet time.

Motivation

The millennium is upon us. The age of the internet arrived long ago. Why are we still coordinating meetings across timezones? Fortunately internet time โ€” which splits the day into 1000 beats and which is consistent across the world โ€” is here to fix all that.

Example: you are in central Europe and wish to organise a meeting with your friend in Tokyo during your lunch. Instead of calculating what time it is in Tokyo then, just tell your friend: "let's talk at @500!".

Installation

Install locally:

yarn add dot-beat-time

Alternatively dot-beat-time is also published as an ES module, meaning that you can import it directly using CDNs like pika.dev.

API

fromDate

fromDate(date: Date, long?: boolean): string

Takes a standard JS Date and outputs as an internet time formatted string e.g. @255. If true is passed to the second argument, the beat will be fractional e.g. @255.50.

now

fromDate(long?: boolean): string

Outputs the current time as a internet time formatted string e.g. @650. If true is passed to the second argument, the beat will be fractional e.g. @650.73.

Credit

The calculation for determining the current beat time has been taken from the beats rust crate.

dot-beat-time's People

Contributors

dependabot[bot] avatar sgwilym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.