Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Natural language parser for dates (.NET)?

I want to be able to let users enter dates (including recurring dates) using natural language (eg "next friday", "every weekday"). Much like the examples at http://todoist.com/Help/timeInsert

I found this post, but it's a bit old and offered only one solution that I'm not entirely content with. I thought I'd resurrect this question and see: are there any other .NET libraries out there that do this kind of date parsing?

like image 251
Crescent Fresh Avatar asked Jan 21 '09 20:01

Crescent Fresh


2 Answers

I know it's not an optimal solution but you can also try to port the dateJs library to .net

It handles things like today; tomorrow; July 2008; next friday; last April; 2004.08.07; 6/4/2005; 8:15 PM; 22:30:45; +5years

like image 191
Vitor Silva Avatar answered Sep 22 '22 13:09

Vitor Silva


I don't know of anything that you can use with the framework today that will allow you to do this, but if you are content with playing around with future bits, you can check out Oslo, and make your own textual DSL.

This article shows how to do exactly what you are trying to do:

http://www.infoq.com/articles/natural-language-date-dsl-oslo

like image 44
casperOne Avatar answered Sep 21 '22 13:09

casperOne