Comments (7)
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.
woah, weird, this was with 0.11.x, I'll try again tomorrow on 0.10.x
from date.
@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.
Hey @matthewmueller let me know if you need help :)
from date.
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.
@bulkan awesome! the 3 big things are:
- getting english numbers working (
in thirty minutes
) - getting months working (
march 5th
,january sixth
,12th of march
) - and #2
from date.
1.
sounds interesting. I shall work on it
from date.
Related Issues (20)
- post meridiem is ignored in `"at 3:00 p.m."`, but not in `"at 3:00 pm"`
- Why are you returning a default date when the supplied input is invalid? HOT 1
- Unofficial date.js has new v4.0.0 - possible malware
- How to get start and end date of current month and week?
- function to determine if an input is valid or not
- var _year = 56 * _week
- Add TypeScript support
- Fixes with NLP HOT 2
- Decimal values cause unexpected results
- "100 days ago" not working HOT 5
- Return error if date not understood HOT 2
- '100 days from now' not working HOT 1
- Security Vulnerability in npm package
- Querying 'next monday' on a monday gives you today, when it should return next week's monday
- Error using standalone file in dist HOT 3
- Today is tomorrow HOT 1
- 'at 6.09am' does not work but 'at 6:09am does'
- in 120 seconds return wrong time. HOT 1
- date is undefined: can't import module HOT 1
- date("30 days ago at 18:00") gives date which is 1 month ahead in nodeJS. (instead of 1 month old date)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from date.