iainbeeston / nickel

Nickel extracts date, time, and message information from naturally worded text.
MIT License
113 stars 17 forks source link

Same day event #4

Closed ericchernuka closed 4 years ago

ericchernuka commented 10 years ago

I have a use case for a same day event and parsing it without context of a future date. This would be more akin to how Google Calendar works when you are creating an event on a specific day.

n = Nickel.parse("meeting with Jimmy at 7am", Time.now)
n.message                       #=> "meeting with Jimmy"
n.occurrences.first.start_date  #=> "20140207"
n.occurrences.first.start_time  #=> "070000"
iainbeeston commented 10 years ago

Yeah, that should work. For future reference, here's what I get right now:

n = Nickel.parse("meeting with Jimmy at 7am", Time.now)
n.message #=> "meeting with Jimmy"
n.occurrences #=> []

If instead I explicitly specify today, eg.

Nickel.parse("meeting with Jimmy at 7am today", Time.now)

Then it works exactly as in your example. I'll take a look

mwlang commented 7 years ago

related to #31

Is this project active?