Skip to content

How to set a time? #202

Answered by Gummibeer
indyjonesnl asked this question in Q&A
Discussion options

You must be logged in to vote

That's a problem right now - Time, Date and DateTime schema.org types are all assigned the DateTimeInterface php type.

case 'Date':
case 'Time':
case 'DateTime':
return ['\DateTimeInterface'];

And the DateTimeInterface php type is always formatted as atom string.
if ($property instanceof DateTimeInterface) {
$property = $property->format(DateTime::ATOM);
}

It would need some additional data passing from the spec parser to the payload serializer or some additional interfaces …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by indyjonesnl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants