All Projects → agenda → Human Interval

agenda / Human Interval

Licence: other
Human readable time distances for javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Human Interval

Iso8601
Ruby parser to work with ISO8601 dateTimes and durations — http://en.wikipedia.org/wiki/ISO_8601
Stars: ✭ 70 (-80.56%)
Mutual labels:  interval, time, date
Period
PHP's time range API
Stars: ✭ 616 (+71.11%)
Mutual labels:  interval, time, date
Date And Time
A Minimalist DateTime utility for Node.js and the browser
Stars: ✭ 99 (-72.5%)
Mutual labels:  parse, time, date
date-extractor
Extract dates from text
Stars: ✭ 58 (-83.89%)
Mutual labels:  time, parse, date
react-picky-date-time
A react component for date time picker. Online demo examples
Stars: ✭ 41 (-88.61%)
Mutual labels:  time, date
Time
Simple time handling in Rust
Stars: ✭ 334 (-7.22%)
Mutual labels:  time, date
Timestamp
⏰ A better macOS menu bar clock.
Stars: ✭ 296 (-17.78%)
Mutual labels:  time, date
React Datetime Picker
A datetime picker for your React app.
Stars: ✭ 294 (-18.33%)
Mutual labels:  time, date
fluent-plugin-http-pull
The input plugin of fluentd to pull log from rest api.
Stars: ✭ 19 (-94.72%)
Mutual labels:  parse, interval
vue-timeselector
🕒 Simply customizable powerful time picker for Vue.js
Stars: ✭ 41 (-88.61%)
Mutual labels:  time, date
dayjs
Extended fork of Day.js - 2KB immutable date library alternative to Moment.js
Stars: ✭ 36 (-90%)
Mutual labels:  time, date
rescript-date
📆 Date manipulation in ReScript.
Stars: ✭ 101 (-71.94%)
Mutual labels:  time, date
chronos
One library to rule the time
Stars: ✭ 17 (-95.28%)
Mutual labels:  time, date
moment-cache
⏱ Simple utility to cache moment.js results and speed up moment calls.
Stars: ✭ 29 (-91.94%)
Mutual labels:  time, date
time-formater
在javascript中显示日期。
Stars: ✭ 44 (-87.78%)
Mutual labels:  time, date
nepali-datetime
Python's core datetime inspired nepali datetime (BS date & NPT) package 🇳🇵
Stars: ✭ 36 (-90%)
Mutual labels:  time, date
edtf.js
Extended Date Time Format (ISO 8601-2 / EDTF) Parser for JavaScript
Stars: ✭ 44 (-87.78%)
Mutual labels:  time, date
date-php
这是一个Javascript模仿PHP日期时间格式化函数,使用方法和PHP非常类似,有丰富的模板字符,并在原来的基础上增加了一些模板字符。 This is a date function that implement PHP in Javascript. It is very similar to PHP, has rich template characters, and enhances some template characters on the basis of the original.
Stars: ✭ 24 (-93.33%)
Mutual labels:  time, date
Maya
Datetimes for Humans™
Stars: ✭ 3,298 (+816.11%)
Mutual labels:  time, date
Md Date Time Picker
An implementation of Material Design Picker components in vanilla CSS, JS, and HTML
Stars: ✭ 272 (-24.44%)
Mutual labels:  time, date

Human Interval

Human-readable interval parser for Javascript.

Converts words written in English to numbers by using node-numbered.

Originally inspired by matthewmueller/date.

Uses

Human Interval is used by job scheduling libraries such as Agenda and Bree. They are a job schedulers for Node.js with cron expression syntax, human-friendly times, Dates, and more!

Example usage

const humanInterval = require('human-interval');

setTimeout(() => {
  // Do something!
}, humanInterval('three minutes'));

More sophisticated examples

Human Interval understands all of the following examples:

humanInterval('minute');
humanInterval('one minute');
humanInterval('1.5 minutes');
humanInterval('3 days and 4 hours');
humanInterval('3 days, 4 hours and 36 seconds');
humanInterval('4 months, 3 days, 5 hours and forty-five seconds');

The full list

Units

Supports the following units in the plural and singular forms:

  • seconds
  • minutes
  • hours
  • days
  • weeks
  • months — assumes 30 days
  • years — assumes 365 days

Wordy numbers

Supports numbers being written out in English words.

humanInterval('five minutes');

Hyphenated numbers

Supports hyphenated numbers.

humanInterval('twenty-five seconds');

Negative numbers

Supports negative numbers if the time starts with a - symbol immediately followed by a number.

humanInterval('-2 minutes');

License

The MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].