{% set output, now = '', "now"|date('U') %}
{% for type, data in site.availability %}
{% set text, status, start, end = '', site.availability[type].available, site.availability[type].start,
site.availability[type].end %}
{% if type == 'day' %}
{% if status == 'yes' %}
{% set text = 'Available for day contract work' %}
{% elseif status == 'no' %}
{% set text = 'Not available for day contract work' %}
{% endif %}
{% elseif type == 'evenings' %}
{% if status == 'yes' %}
{% set text = 'Available for weekend/evening freelance work' %}
{% elseif status == 'limited' %}
{% set text = 'Limited availability for weekend/evening freelance work' %}
{% elseif status == 'no' %}
{% set text = 'Not available for weekend/evening freelance work' %}
{% endif %}
{% endif %}
{% if start %}
{% if start|date('U') > now %}
{% set text = text ~ ' starting ' ~ start|date('F Y') %}
{% endif %}
{% if end %}
{% set text = text ~ ', until ' ~ end|date('F Y') %}
{% endif %}
{% elseif end %}
{% set text = text ~ ', until ' ~ end|date('F Y') %}
{% endif %}