sfsam / Itsycal

Itsycal is a tiny calendar for your Mac's menu bar. http://www.mowglii.com/itsycal
MIT License
3.26k stars 234 forks source link

[Feature request] Natural language parser for new event's date #193

Open aym-0401 opened 2 years ago

aym-0401 commented 2 years ago

First of all, thanks for your awesome app! I tried and even purchased other calendars, but Itsycal is by far my favourite.

I'd love to see a natural language parser to suggest the event's date when entering a new event, like the quick event creator function in the iCal / macOS Calendar app.

For instance, when typing: "Go to the theater tomorrow 20PM-21PM", the program should suggest the accurate hour and date and, once saved in the calendar, the event should be renamed as "Go to the theater" only.

I don't know anything about Objective-C / Swift / Cocoa but AFAIK, there is some interoperability. Some suggestions: Stack Overflow - Is there a way to convert a natural language date NSString to an NSDate

Deprecated Apple API (?): Doc and doc

Best option: Github - SwiftyChrono

batmac commented 2 years ago

I've put together something a bit like what you describe I think. It adds a text field for "natural date" input above the "New event" field, using this forked SwiftyChrono I've made (for swift 5 support).

It's here ("master" branch is only the needed diff, "full" branch is the complete Xcode project ready to be compiled (with my key & so a new bundle ID).

Could you maybe try it and let me know what you think? It's probably a bit rough for now but I'd love to make it better :)

sfsam commented 2 years ago

Hi @batmac. I took a look and appreciate your effort. At this time, I'm not planning on adding natural language parsing to Itsycal, though people are free to fork the code and add it to their own copy as they see fit. To even consider it, I would need to see Apple support the feature natively and be sure that they would maintain support and upgrades. They used to have something sort of like this, but they deprecated it. Depending on a 3rd party framework for this (it has to support all languages that Itsycal supports and may support in the future - perfectly) is a no-go for me. It creates too many support and maintenance issues.

batmac commented 2 years ago

hey I understand perfectly ! ( I've done this because I have difficulties to use the current datepicker... and this was fun.) I greatly appreciate your app, thank you very much to share it with us.

an Itsycal lover,