Skip to content
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

How to handle AMAZON.Date in .NET #11

Open
Blackbaud-BenLambert opened this issue Jul 27, 2016 · 4 comments
Open

How to handle AMAZON.Date in .NET #11

Blackbaud-BenLambert opened this issue Jul 27, 2016 · 4 comments

Comments

@Blackbaud-BenLambert
Copy link

Hey Stefan, thanks for writing this library - it works great! Do you have any utility or library code in FreeBusy that handles parsing the ISO8601 date values coming in from the AVS when a slot is defined as of type AMAZON.Date? In some cases, the incoming string isn't parse-able to a DateTime or DateTimeOffset (for example, if I say "this weekend" the slot value comes in a "2016-W29-WE" which doesn't work with DateTime.TryParse(). Reading the docs on AMAZON.Date I see several formats that likely won't parse. Just wondering if there was a good mechanism for handling this in .NET, or if you just ended up parsing the incoming value for some known regex patterns. Thanks again for putting the time into creating this library!

@stefann42
Copy link
Member

stefann42 commented Aug 4, 2016

Hi, thanks for the kind words. The AMAZON.Date format is based on Java Duration which is a subset of ISO 8601 standard. See http://docs.oracle.com/javase/8/docs/api/java/time/Duration.html and http://en.wikipedia.org/wiki/ISO_8601#Durations for context.

In a future release I'll contribute our parsing code to the library. It doesn't cover 100% of the standard, but we do handle the most frequent patterns.

@ChrisInSeattle
Copy link

Hello,

Yesterday I submitted a pull request with code that parses the amazon date format. It handles all of the cases covered in the Amazon docs (except seasons) and few that show up but aren't mentioned in the docs.

I wrote this for my app. The AmazonSkillKit was such a time saver for me, I figured I'd contribute.

Chris

@stefann42
Copy link
Member

Thanks for the contribution @ChrisInSeattle! I'll review and merge soon.

@smoore4moma
Copy link

You can also handle AMAZON.Date in SQL. If you are pulling from SQL Server, it looks like the attached example.

alexaDate.txt

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

No branches or pull requests

4 participants