Coder Social home page Coder Social logo

days's Introduction

days

A simple CLI tool for calculating how far away dates are from each other. Inspired by WolframAlpha's ability to do this with natural language inputs.

The focus is primarily on days as the unit of time (hence the name of the crate), but support for other units of time โ€” both small and large โ€” is planned.

Features:

  • Calculate the date N days from today.
  • Calculate how many days are left until a given date.
  • Calculate how many days have passed since a given date.

Usage

# install it
cargo install days
# use it!
days since 1970-01-01

Supported commands

You can always run days --help to see the supported commands.

since: Calculate how many days have passed since a given date.

days since 1970-01-01

until: Calculate how many days are left until a given date.

days until 2038-01-19

count: Calculate the date N days from today.

days count 100

Features Yet to Come

The intention is to add support for natural language inputs to make it easier to use on the fly while keeping the feel of a robust CLI tool by providing consistent options for input and output formats.

Currently planned:

  • Support for automatically detecting certain date formats.
  • Support for manually specifying the date format you want to use.
  • Options to output date results in a customisable format (or choose from a list of built-in ones).
  • Options to output number-of-days results in a different unit of time (seconds, weeks, centuries).
  • Support for date-and-time inputs and outputs.
  • Support for calculating number of days between two arbitrary dates.
  • Support for referring to past and upcoming dates by their name (like "Christmas" or "next Tuesday").

Limitations

This tool is based on chrono, the excellent Rust date/time library. Note that this has some limitations when working with dates outside of the Gregorian calendar. See their limitations section for full details.

days's People

Contributors

beaugieskens 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.