我想知道在使用Schema.orgopeningHours
时如何应对银行假期(在英国)和圣诞节假期。
在英国,有几家公司关闭的日期很长,因此这些日期需要排除在外,而且每年也会略有变化:https://www.gov.uk/bank-holidays
该openingHours
属性不允许排除特定日期。
使用时,specialOpeningHoursSpecification
您可以覆盖用openingHours
或openingHoursSpecification
(这是更具表达性的替代方法openingHours
)指定的一般开放时间。
特性specialOpeningHoursSpecification
和openingHoursSpecification
取OpeningHoursSpecification
为值。
在中OpeningHoursSpecification
,您可以使用dayOfWeek
属性指定开始日期。它期望一个DayOfWeek
值(它是一个枚举)。它包含了每一天的一周(A值Monday
,Tuesday
等),也有“特殊”的价值PublicHolidays
:
这代表着公众假期的任何一天;它是某个特定位置所有法定节假日的占位符。
因此,如果您想声明自己在(您所在位置的)公共假日不营业,则可以使用以下方法:
<div itemprop="specialOpeningHoursSpecification" itemscope itemtype="http://schema.org/OpeningHoursSpecification">
<link itemprop="dayOfWeek" href="http://schema.org/PublicHolidays" />
<p itemprop="description">Closed on public holidays.</p>
</div>
(它表示由于opens
未提供该属性而将其关闭。)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句