Skip to content
/ Tims Public
forked from GhomKrosmonaute/Tims

Textual display of millisecond durations and in several languages.

Notifications You must be signed in to change notification settings

Ayfri/Tims

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tims 🕚

  • no dependency
  • optimized and light code
  • typescript typings included
  • deno version of the npm package tims.

Usage

import tims from 'https://deno.land/x/tims/mod.ts';
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
console.log(tims.since(yesterday));
// "1 day"

Methods

Method Description Return Type
between(moment, moment, options) Get the sentence of time past since given moment. string
duration(duration, options) Get the sentence of time between given moments. string
since(moment, options) Get the sentence of given duration. string

Options

interface Options {
  format?: "day" | "year" | "month" | "hour" | "minute" | "second" | "ms"
  locale?: "fr" | "es" | "en"
  full?: boolean
}

Enjoy 🕛

About

Textual display of millisecond durations and in several languages.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%