Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asking for a time tomorrow results in nighttime dates #39

Open
spiffytech opened this issue Oct 18, 2024 · 0 comments
Open

Asking for a time tomorrow results in nighttime dates #39

spiffytech opened this issue Oct 18, 2024 · 0 comments

Comments

@spiffytech
Copy link

If I query Sherlock for "tomorrow at 10", I expect 10:00am every time — the first "10:00" that occurs tomorrow.

However, if I ask in the evening, Sherlock will give me 10:00 pm (22:00) instead.

Sherlock._setNow(new Date('2024-10-17T21:00:00'))

Sherlock.parse('tomorrow at 10')
-> {isAllDay: false, eventTitle: null, 
    startDate: Fri Oct 18 2024 22:00:00 GMT-0400 (Eastern Daylight Time),
    endDate: null, validated: true}

If I ask earlier in the morning, I get 10:00 am:

Sherlock._setNow(new Date('2024-10-17T09:00:00'))

Sherlock.parse('tomorrow at 10')
-> {isAllDay: false, eventTitle: null,
    startDate: Fri Oct 18 2024 10:00:00 GMT-0400 (Eastern Daylight Time),
    endDate: null, validated: true}

The evening behavior seems like a bug to me. It also seems risky that I get different results based on the time of day I ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant