<p>Ended up just repurposing code from the plugin templates. This is working fine for me:</p>
<pre><code>{% if seomatic.site.identity.localBusinessOpeningHours|length %}
   {% macro day(value, day) %}
      &lt;tr&gt;
         &lt;th&gt;{{ craft.app.locale.getWeekDayName(day) }}&lt;/th&gt;
         &lt;td&gt;{{ value[day].open.date|date('g:ia')|replace({':00' : ''}) }}-{{ value[day].close.date|date('g:ia')|replace({':00' : ''}) }}&lt;/td&gt;
      &lt;/tr&gt;
   {% endmacro %}
   {% from _self import day %}

   {% set startDay = currentUser.getPreference(&quot;weekStartDay&quot;) ?? craft.app.config.general.defaultWeekStartDay %}
   {% set days = (startDay..6) %}

   {% if startDay != 0 %}
      {% set days = days|merge(0..(startDay -1)) %}
   {% endif %}

   &lt;table&gt;
      {% for i in days %}
         {{ day(seomatic.site.identity.localBusinessOpeningHours, i) }}
      {% endfor %}
   &lt;/table&gt;
{% endif %}
</code></pre>

CC BY-SA 4.0
2022-04-25T08:51:35.450Z
2022-04-25T08:51:35.450Z
Ian Ebden
<p>I could use some help outputting opening hours from SEOmatic's Site Settings/Identity. The docs aren't clear on this, and the example at <a href="https://github.com/nystudio107/craft-seomatic/issues/843" rel="nofollow noreferrer">https://github.com/nystudio107/craft-seomatic/issues/843</a> doesn't work for me. Any help much appreciated.</p>

<craft3><plugin-seomatic>
Outputting Opening Hours in SEOmatic
# Outputting Opening Hours in SEOmatic

(Asked by: username_0 on 2022-04-22)

I could use some help outputting opening hours from SEOmatic's Site Settings/Identity. The docs aren't clear on this, and the example at <https://github.com/nystudio107/craft-seomatic/issues/843> doesn't work for me. Any help much appreciated.

**Tags:** craft3, plugin-seomatic

---

## 1 answers

### Answer by username_0 on 2022-04-25. Score: 1 | Accepted answer

Ended up just repurposing code from the plugin templates. This is working fine for me:
{% if seomatic.site.identity.localBusinessOpeningHours|length %}
   {% macro day(value, day) %}
      
         {{ craft.app.locale.getWeekDayName(day) }}
         {{ value[day].open.date|date('g:ia')|replace({':00' : ''}) }}-{{ value[day].close.date|date('g:ia')|replace({':00' : ''}) }}
      
   {% endmacro %}
   {% from _self import day %}

   {% set startDay = currentUser.getPreference("weekStartDay") ?? craft.app.config.general.defaultWeekStartDay %}
   {% set days = (startDay..6) %}

   {% if startDay != 0 %}
      {% set days = days|merge(0..(startDay -1)) %}
   {% endif %}

   
      {% for i in days %}
         {{ day(seomatic.site.identity.localBusinessOpeningHours, i) }}
      {% endfor %}
   
{% endif %}


---

