Giter VIP home page Giter VIP logo

rechron's People

Contributors

m-haisham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rechron's Issues

Implement proper exceptions

The project currently raises raw Exception objects. This is considered bad practice and makes it hard to capture just those raised by the library.

We should create a base exception that will be used for this library.

Additional natural forms to consider

This is a well-needed client-side alternative to something like https://github.com/tj/go-naturaldate -- nicely done and thank you!

Here are a few additional forms to consider:

  • last [week|month|quarter|year] / next [week|month|quarter|year]
  • enhancing timeframes to have shorthand forms (e.g., "d" for day, "w" for week, "m" for month, "h" for hour, "min" for minute, "s" and "sec" for second, etc.)
  • enhance direction to support "from now" to indicate in the future
  • if possible make the comma in the duration_chain optional (e.g., support things like 2 hours 25 seconds ago instead of hours, 25 seconds ago)
  • enhancing duration_chain to support an alternate form where a time is specified instead of an additional duration, e.g., 7 days ago at 12:35pm or tomorrow at 7:05:35

Also, consider enhancing the grammar expression to support adding or subtracting another relative period, e.g., something like:

expression => relative (("+"|"-") duration_chain)?

This would enable expressions like:

  • now-4d
  • 7 days ago + 12 hours, 25 minutes

Add support for precise datetime parsing

The parse currently only understands relative datetimes. The previous update (#5) added support for adding and subtracting duration from DateTime using + and '-' respectively. This currently lacks support for parsing precise DateTime strings such as 18:20:30.

This should add support for parsing the following strings.

  • 12:00
  • 12:30:00
  • a hour from 00:00
  • 12 minutes 5 seconds + 12:00

This issue is derived from #4.

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.