AlexaSkillsKit.NET icon indicating copy to clipboard operation
AlexaSkillsKit.NET copied to clipboard

Code to parse datetime ranges sent from alexa

Open ChrisInSeattle opened this issue 8 years ago • 4 comments

This code parses the azure DATE type, for example:

"Yesterday" "This week" "Last month" "June 2010" "3rd quarter" " Call AlexaDateRangeConverter.Convert() passing in the string from Alexa and the offset of the application time to UTC. This returns an AlexaDateRange with a start and end date of the parsed range.

ChrisInSeattle avatar Feb 19 '17 03:02 ChrisInSeattle

@ChrisInSeattle Thanks for you contribution! Please sign the Contributor License Agreement (see your pull request) so we can accept it in the project.

stefann42 avatar Apr 18 '17 03:04 stefann42

does not handle simple "2017" which is a result of saying "this year" or "next year" etc.

jetcz avatar Aug 11 '17 14:08 jetcz

I did something similar with parsing the Alexa date for a SQL stored procedure:

https://github.com/smoore4moma/tms-api/blob/master/database/procMomaAlexaExhibitions.sql

The use case is "Alexa, ask {skill} what is happening this weekend"

Weekends look like this in the Alexa response '2019-W20-WE'. I think it would be good to include -WE responses. @ChrisInSeattle

smoore4moma avatar May 05 '19 14:05 smoore4moma

Thanks for the contribution! This definitely might be very useful. Still I'm a bit uncertain whether or not this new classes belong to this core library.

This feels like it's a separate functionality, that doesn't require integration with the library. Anybody interested in this functionality can take appropriate classes from this PR and add to own project with any modifications necessary for person's use case.

So my question would be: Is there any common and documented format for how Alexa dates/date ranges might look like, that would justify making this or similar PR part of this library?

ElvenMonky avatar Aug 28 '20 04:08 ElvenMonky