schema.org:同一天有多个开放时间

编程入门 行业动态 更新时间:2024-10-10 11:24:37
本文介绍了schema:同一天有多个开放时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为一家小型商店建立一个网站,并希望实施 schema-microdata-markup.问题":这家商店的营业时间为周二至周五——这些天从 10:00 到 14:00 和从 16:30 到 23:00.所以我就这样实现了营业时间……

I'm building a website for a small store and want to implement schema-microdata-markup. The "problem": The store is opened from Tuesday till Friday – from 10:00 till 14:00 AND from 16:30 till 23:00 on these days. So I implemented the opening hours like this…

<time itemprop="openingHours" datetime="Tu-Fr 10:00-14:00, 16:00-23:00">XYZ</time>

但是这样,HTML 验证器说...

But this way, the HTML-validator says…

元素时间上的属性日期时间的错误值 Tu-Fr 10:00-14:00、16:00-23:00:文字不满足时间-日期时间格式.

Bad value Tu-Fr 10:00-14:00, 16:00-23:00 for attribute datetime on element time: The literal did not satisfy the time-datetime format.

我怎样才能实现这些每天多个开放时间?或者使用 -tag 无法做到这一点,我必须将其更改为 -tags?谢谢你的帮助!:-)

How can I implement these multiple opening hours a day? Or is it impossible to do this with the <time>-tag and I have to change it to <meta>-tags? Thanks for your help! :-)

推荐答案

问题是 schema 用于 openHours 的符号对 时间元素的 HTML5 规范.

The problem is the notations schema uses for openingHours are just not (yet) valid by the HTML5 spec for the time element.

您可以复制 LocalBusiness 中的所有示例" rel="nofollow">验证器,它们都将无法通过验证.

You can copy all the examples from LocalBusiness in the Validator and they will all fail validation.

除非规范包含在时间元素中编写openingHours 的定义,否则恐怕您将不得不忽略HTML 验证器.

Until the spec contains a definition to write openingHours in a time element you will have to ignore the HTML validators I'm afraid.

顺便说一句.schema 站点上的文本暗示您可以在一个值中定义多次:

BTW. The text on the schema site implies you could defines multiple times in one value:

商家的营业时间.营业时间可以指定为每周时间范围,从天开始,然后是每天的次数.

The opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day.

更多推荐

schema.org:同一天有多个开放时间

本文发布于:2023-11-27 11:17:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637846.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   同一天   时间   schema   org

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!