Schema.org for closed on a holiday / given date

落爺英雄遲暮 提交于 2019-12-06 13:01:07

问题


How do I properly markup holiday hours when a business is closed on the holiday?

Normal holiday hours markup example:

<li itemprop="openingHoursSpecification" itemscope="" itemtype="http://schema.org/OpeningHoursSpecification" class="holidayHours">  
  <span itemprop="validFrom" content="2014-05-26">Memorial Day Hours, Monday, May 26th:&nbsp;</span>  
  <span itemprop="validThrough" content="2014-05-26"></span>  
  <span itemprop="opens" content="09:00">9 am</span>&nbsp;-&nbsp;<span itemprop="closes" content="15:00">3 pm</span>  
</li>

What is the schema.org or Google preferred way to show closed on a holiday? Would this be correct?

<li itemprop="openingHoursSpecification" itemscope="" itemtype="http://schema.org/OpeningHoursSpecification" class="holidayHours">  
  <span itemprop="validFrom" content="2014-05-26">Memorial Day Hours, Monday, May 26th:&nbsp;</span>  
  <span itemprop="validThrough" content="2014-05-26"></span>  
  <span itemprop="opens" content="00:00">CLOSED<span itemprop="closes" content="00:00"></span>  
</li>

回答1:


This is the ld+json format, but say you are closed for Christmas, just leave the opening & closed hours blank, like I did for regular openingHours below. This test business is closed Sunday, so I just don't enter any time for it at all.

 ...
 "telephone": "123-555-1212",
 "openingHours": "Mo,Tu,We,Th 09:00-19:00, Fr 09:00-20:00, Sa 09:00-18:00",
 {
     "@type": "OpeningHoursSpecification",
     "validFrom": "2015-12-25",
     "validThrough": "2015-12-25"
  },
  "address": {
      ...
  }



回答2:


Don't know if things has changed since you posted this @Nathan but this is the only way I could get https://developers.google.com/structured-data/testing-tool/ to validate properly. By specifying "openingHoursSpecification" outside of the brackets.

"openingHours": "Mo,Tu,We,Th 09:00-19:00, Fr 09:00-20:00, Sa 09:00-18:00",
"openingHoursSpecification":
        {
            "@type": "OpeningHoursSpecification",
            "validFrom": "2015-12-25",
            "validThrough": "2015-12-25"
        }



回答3:


You could possibly handle it that way, Christopher, but you need to mark up the time down to the seconds (00:00:00) in this situation. It's because the business would open at 00:00:00 and close at 00:00:01. Or another way to do it would be simply to specify the days of the year that the business is open and leave out any mark up for the days that the business is closed.



来源:https://stackoverflow.com/questions/24019164/schema-org-for-closed-on-a-holiday-given-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!