Closed drodrig closed 7 years ago
Awesome. Can you try adding tests for this new behavior?
Some of your tests already address the reminders in the past situation. Running the tests actually revealed some bugs in my code, so I re-factored.
I modified one existing test (remind me {weekday} to {task}) to account for every day name of the week.
I added one test (remind me at {timeWithHourOnly} to {task}) to account for a single-digit number for the time of day.
I moved my code in lib/parse.py to its own function: futurizeReminder() for easier maintenance.
Question: Do I create a new pull request for the test file (test/parse.py)? Sorry, I'm new to working with github.
-------- Original Message -------- Subject: Re: [zeke/remind-me] Updates to parse.py (#63) Local Time: December 2, 2016 12:03 AM UTC Time: December 2, 2016 5:03 AM From: notifications@github.com To: zeke/remind-me remind-me@noreply.github.com drodrig drodrig@magicbrain.com, Author author@noreply.github.com
Awesome. Can you try adding tests for this new behavior?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zeke/remind-me/pull/63#issuecomment-264374083, or mute the thread https://github.com/notifications/unsubscribe-auth/ACSc1FzyAKyyd6z1ENYfq8CjQUqLJJayks5rD6aOgaJpZM4LAsXS .
I think we're good to go unless you need anything else. I see that the test files got added to the auto-magically when I committed them to my fork.
Running "npm test" gives me:
26 passing (121ms) 1 pending
Thanks! This change is published in 1.6.1
npm i -g remind-me@latest
The updates herein provide three changes.
The first change sets result.time as a Date object when an interval is found by chrono (instead of a result.time value of seconds since epoch). The change helps unify the result.time object:
The second change allows for a single-digit time within a reminder string. Currently chrono throws an exception. By adding the ":00" chrono can understand the time string (e.g. "remind me to go for a walk at 9"):
The final change checks if chrono returned a time in the past and tries to futurize it by adding 12 hours, as chrono will sometimes return a time in the past: