Time sensor for rubies / rails

Does anyone know something similar to Date.js in Ruby? Something that could return a date object from something like: "two weeks from today." The Remember the Milk webapp includes this feature in its system and is incredibly easy to use.

I would only use the Date.js library, but since it has client-side limitations. If the user does not have javascript enabled, functionality will be lost. This will affect mobile phone users who, ideally, will use our system via text message (SMS).

I would like to use a solution that already exists, but if it is not so difficult to port this code to Ruby? I really do not really understand the interpretation of natural language, but it looks like it will take some time.

Thanks.

+6
ruby datetime ruby-on-rails nlp
source share
1 answer

Do not forget that everything that is an object in Ruby, you already have a pretty clear expression from the language itself:

2.weeks.from_now.utc 

will be the equivalent of "two weeks from today."

However, for a real natural language, it may be chronic; it may be a more specialized library in rubyforge .

 Chronic.parse('this tuesday 5:00') #=> Tue Aug 29 17:00:00 PDT 2006 
+15
source share

All Articles