About a year ago I needed to recognize dates in the text that users enter. I had to sort out the regular expressions a bit and write a function, the input of which is a text string, and the result is a recognized date.
Example and code in jsFiddle .
The code does not pretend to be a sample; it is an outright noodle of a person who is programming as a hobby. But for a year now he has been quietly working and fulfilling his functions in 3 projects.
')
If you want to use it and, moreover, if you want to show it to programmers, you will have to refine and optimize it, I haven't got a hand before that.
By going to the jsFiddle example, you can try different options and easily figure out how it works and play with different phrases. He recognizes all the main variants of human writing.
Used in Javascript is very simple:
jsParseDate(" 10 12:30 ");
I hope at least someone is useful. And even more I hope that there will be an enthusiast who will write a normal plugin, who will be able to do the same and, among other things, will understand English. I would love to use this plugin.
The plugin will be widely used in planners. For example, I use it to quickly add cases to my program, to which you can add cases by SMS to a specific phone number or by writing a similar line in the subject line of the letter, which I send to my program. Managers who use one of my programs plan business affairs related to clients in corporate CRM. Recognition occurs on the fly, so it is faster than clicking in the calendar.
PS: Pros, once again, sorry for the quality of the code. And you can show us the class, "fork" the project in Fiddle and specify the link in the example.
PS: The example uses Angular.js and those who are not familiar with it can appreciate how easy it is to write examples.