joestelmach / natty

Java natural language date parser
http://natty.joestelmach.com/
MIT License
520 stars 183 forks source link

Javascript version? #84

Open fkleedorfer opened 10 years ago

fkleedorfer commented 10 years ago

Thanks and Congratulations on your highly useful library! I understand it is made with ANTLR, and I found out that a javascript generator target is in the works: https://theantlrguy.atlassian.net/wiki/display/ANTLR4/JavaScript+Target Have you thought about a javascript version of natty (which would be extremely useful for some scenarios)? How would one go about doing that? I thought about trying it, but I wasn't able to find any grammar files in your project. I have to admit that I haven't worked with ANTLR before so chances are that I missed something.

michaelahlers commented 10 years ago

This is a good idea, but pending an implementation by @joestelmach you might want to try Moment.js. By far, it's the best JavaScript datetime library I've come across, and while it's parsing capabilities aren't as rich as Natty's, it certainly holds in own for interpreting free-form, absolute dates.

fkleedorfer commented 10 years ago

For parsing natural language dates, I only know of moment-natural which is not very versatile. Is there anything else for moment? Otherwise sugarjs and chrono give good results, but natty is way better.

michaelahlers commented 10 years ago

Not that I know about (and you're way ahead of me).

iradul commented 9 years ago

Moment.js is probably the best datetime library but if you need just a javascript date parser datejs is the best.