DamascenoRafael / reminders-menubar

Simple macOS menu bar application to view and interact with reminders. Developed with SwiftUI and using Apple Reminders as a source.
GNU General Public License v3.0
2.62k stars 118 forks source link

The automatic date detection does not detect certain expressions #136

Closed pearresearch closed 1 year ago

pearresearch commented 1 year ago

Not an expert, and not sure if this is an Apple issue. I am attaching a video showing the issue. Today is May 3rd in my country, for context. I suppose this should automatically assume that the 5th means 5th May (not March). (dd-mm-yyyy)

https://user-images.githubusercontent.com/110237207/235774634-1721d8cc-6156-4d9d-be2c-bbb262814221.mov

DamascenoRafael commented 1 year ago

Thanks for the feedback @pearresearch. We are using Apple's NSDataDetector API to detect dates, this results in some advantages like support for different languages, but also some disadvantages.

About the specific case you demonstrated, by my tests if you just type "on 5th" it won't be detected as a date. So what's happening is that only the time ("at 5PM") is being detected and so it's being assumed to be for the current day. I believe the format being presented to you is mm/dd/yyyy. If the time had already passed it would be assumed that the day would be the next day.

I'm going to open a new issue for a feature that I was already planning which would be hilighting what is being detected as a date in the typed text. So in this case it would be possible to notice that only "at 5PM" would be highlighted. Do you believe this could help with the perception that the date is being detected wrong?

pearresearch commented 1 year ago

I believe that would totally help. Thank you dev! Appreciate that.

pearresearch commented 1 year ago

Currently, in v1.8, the date isn't detected at all. That is done by intention, I suppose. Demonstrated below:

https://github.com/DamascenoRafael/reminders-menubar/assets/110237207/4f8204d1-8851-49f8-b3d9-6110012ad724

Also, I'd like to state another bug; not sure if that crept in; the first time I tried to add a reminder right now (just before this video recorded above), it added it on the "previous day" automatically. In other words, as soon as I entered the reminder, it popped up to me saying that the reminder was "due" yesterday.

DamascenoRafael commented 1 year ago

You may have enabled the option to auto suggest today as the date. In this case, the behavior you showed is the same as in the previous version: the suggested date is today's date and the parser does not look for dates as you type.

I could see that you were trying to define only a time, but I would need to investigate a way to combine the auto-suggested date with the time-only detection. I will open a separate issue for this feature.

DamascenoRafael commented 1 year ago

@pearresearch About the other bug where the reminder appeared as due yesterday, could you give more details? I think I misunderstood what happened.

pearresearch commented 1 year ago

@DamascenoRafael Thank you for being so prompt. I did not enter the date as stated; my auto-suggest date was enabled. It took yesterday's date instead of taking the newer date (what I believe happened is below)

I tried to recall the steps I took, and I believe I started typing a reminder and did not complete it.

Let's say I start typing a reminder on 05/11/2023 at 11:55 PM, but do not complete it. I leave it halfway and go back to entering it on 05/12/2023 at 12:05 AM. In this instance, the date from yesterday (i.e 05/11/2023) remains and as soon as the reminder is added, it pops up as "due" from yesterday (i.e 05/11/2023).

I guess this is being too nitpicky.

Tl:dr version: Once a reminder is started to be added, the auto-suggested date does not update itself automatically despite the day changing. I will check it tonight in my time zone and update this post.

DamascenoRafael commented 1 year ago

@pearresearch thanks for the feedback. I did some investigation and found a small bug, but I'm not sure if that's what you experienced.

When the reminder starts to be typed and the app suggests a date (whether the auto suggest today option is enabled or not) the date being displayed will be the date that will be saved.

So if you have auto suggest today enabled and you start typing a reminder at 11:55PM and only finish typing at 12:05AM, the reminder will be created with yesterday's date (the same date that is being displayed since when you started to type).

The bug I found is that the date wasn't being set when you start typing, but at the last moment the textfield was cleared. So if the last reminder was created on 05/11 (and then the textfield was no longer used) then if you were to create a new reminder on 05/13 at 5PM the suggested date would continue to be 05/11. I'll be fixing this right now.

pearresearch commented 1 year ago

I see, so every new reminder every new day the person will face an issue their first entry. That fits the scenario very well. It was the first day I enabled the auto-suggest date too. Edit: All aside, it's amazing you take out the time to work on this app, especially for the support, for free. @DamascenoRafael I'm grateful. This app has been a true timesaver.

DamascenoRafael commented 1 year ago

Thanks @pearresearch, I'm glad you are enjoying the app!! :)

Do you think we can close this issue? I believe that the issues that were raised were somehow addressed. The issue of the Apple API detecting more expressions is an issue that should/could only be addressed by Apple. Another option would be to use another API, but I don't think there is a viable option at the moment (with wide language support).

I opened a new issue about suggest time when auto suggest today's date option is enabled (#140).

pearresearch commented 1 year ago

Thank you again dev! Issues are resolved.