1 min read
Using the datejs library to process natural language speech and return a specific date, and speak the result with the html 5 speech synthesis api.
A few notes
- there seems to be a few bugs when combining relative dates ("today", "tomorrow") with times; all times seem to render as AM
- slight bug with the speech as it sometimes says "XX third" but also says "t" "h" (ordinal is repeated)
- this speech portion of this demo works on the desktop and Android versions of Chrome
- the date is based on the user's system clock
For this test, click a relative date from the list. The specific date you requested will be displayed in the text field and will be spoken to you.
Check out the code on GitHub.