KrofDrakula / microdata-tool

A drop-in script for testing and browsing HTML5 microdata
http://krofdrakula.github.com/microdata-tool
96 stars 18 forks source link

iso format time not displaying #5

Closed eugeneiglesias closed 13 years ago

eugeneiglesias commented 13 years ago

KrofDrakula,

First of all awesome tool. I found an issue that you may want to fix. When using start dates following the ISO format:

<meta itemprop="startDate" content="2011-04-21T20:00">

as seen on: http://schema.org/AggregateOffer

The startdate comes up with a blank result "startdate=" in the box

When I test it in the rich snippet testing tool (http://www.google.com/webmasters/tools/richsnippets) the date shows up.

I wish I could have helped you with the code but my regex is very poor.

Thanks!

KrofDrakula commented 13 years ago

Ah, it seems I've misinterpreted the date format. I'll reread the spec for ISO date formats and update this as soon as possible.

KrofDrakula commented 13 years ago

On second reading, I see you're using a different entity type – the script currently only supports the following types:

These are set in the validationRules on line 49. Currently, I have yet to externalize these validators to support fetching these definitions (or even parsing them from the actual URL) on-the-fly to keep them in sync with the schemas.

A quick workaround in your case would be to simply copy the '.../Offer' into a new property called http://schema.org/AggregateOffer and basically copy/paste the validator.

I'm going to create a new issue as a feature request that will enable downloading schema definitions when the script executes, rather than carrying them in-script as it does now.