Giter VIP home page Giter VIP logo

Comments (7)

bulkan avatar bulkan commented on September 27, 2024

Interesting in node v0.10.25 using the current master branch I get

>   console.log(date('50 minutes ago'));
Wed Feb 05 2014 15:13:08 GMT+1100 (EST)

>   console.log(date('50 minutes from now'));
Wed Feb 05 2014 16:53:09 GMT+1100 (EST)

from date.

tj avatar tj commented on September 27, 2024

woah, weird, this was with 0.11.x, I'll try again tomorrow on 0.10.x

from date.

matthewmueller avatar matthewmueller commented on September 27, 2024

@visionmedia sweet! let me know how it works out for you. it's definitely a bit rough around the edges (esp with month queries) but i'm planning on picking it back up again soon.

from date.

bulkan avatar bulkan commented on September 27, 2024

Hey @matthewmueller let me know if you need help :)

from date.

matthewmueller avatar matthewmueller commented on September 27, 2024

seems to work okay for me. i tried 10.22 & 11.11:

console.log(date('50 minutes ago'))
console.log(date('50 minutes from now'))

Wed Feb 05 2014 11:52:51 GMT+0100 (CET)
Wed Feb 05 2014 13:32:55 GMT+0100 (CET)

@visionmedia also, one thing to keep in mind is that this parser prefers future dates (was made for scheduling). so if you type ambiguous phrases like '50 minutes', it'll assume '50 minutes from now'. that might not be ideal for logging. definitely down to explore ways to make it more general though.

from date.

matthewmueller avatar matthewmueller commented on September 27, 2024

@bulkan awesome! the 3 big things are:

  1. getting english numbers working (in thirty minutes)
  2. getting months working (march 5th, january sixth, 12th of march)
  3. and #2

from date.

bulkan avatar bulkan commented on September 27, 2024

1. sounds interesting. I shall work on it

from date.

Related Issues (20)

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.