March 8th, 2024
Interactive
This is a simple NLP input component that captures your input and detects dates and times to help you create reminders and events.
It works with the Chrono Library under the hood. It's a simple and easy-to-use library for detecting and parsing dates and times. The real challenge for me was to find a way to create a user-friendly input field that allows me to fully customize and style single parts of the input string.
Interactive
I then created a new Highlight plugin that extends the Mark class from the TipTap library. This plugin is responsible for adding the highlight mark to the selected text and for parsing the HTML to find the mark tag.
After the inital setup I created the "getInformation-function" that uses the Chrono library to detect dates and times in the input string.
Now I use the TipTap commands to highlight the detected date string in the input field. It's important to make sure that the correct string is highlighted, so I use the detectedDateString to find the correct start and end position in the input string.
And then I use the Calendar Picker from ShadcnUI to display the detected date to the user.
This project showed me that human-computer interactions need to be seamless. They need to feel so natural that you just do what you always do, and the computer understands what you want. In my opinion, the time where you need to learn how to talk to a computer in daily business is over. The computers should learn to understand you, your needs, and workflows.
Next Interaction
Parallax Image Gridback