Skip to content

Code to parse datetime ranges sent from alexa #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisInSeattle
Copy link

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.

@stefann42
Copy link
Member

stefann42 commented Apr 18, 2017

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

@jetcz
Copy link

jetcz commented Aug 11, 2017

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

@smoore4moma
Copy link

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

@ElvenMonky
Copy link
Collaborator

ElvenMonky commented Aug 28, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants