Datebadge

Datebadge

3 Sep
<!-- datebadge.blade.php -->
<div class="c-datebadge c-datebadge--md" data-uid="68b86deb0c792">
    <div class="c-datebadge__daymonth">
            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__date c-typography__variant--h1" data-uid="68b86deb0c80b">
    3
</span>            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__month c-typography__variant--h4" data-uid="68b86deb0c84a">
    Sep
</span>    </div>
    </div>
@datebadge([
    'date' => date("Y-m-d")
])
@enddatebadge

Datebadge

3 Sep
<!-- datebadge.blade.php -->
<div class="c-datebadge c-datebadge--sm" data-uid="68b86deb0c8ca">
    <div class="c-datebadge__daymonth">
            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__date c-typography__variant--h1" data-uid="68b86deb0c8fc">
    3
</span>            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__month c-typography__variant--h4" data-uid="68b86deb0c92e">
    Sep
</span>    </div>
    </div>
@datebadge([
    'date' => date("Y-m-d"),
    'size' => 'sm'
])
@enddatebadge

Datebadge with time

3 Sep
16:33
<!-- datebadge.blade.php -->
<div class="c-datebadge c-datebadge--md" data-uid="68b86deb0c99b">
    <div class="c-datebadge__daymonth">
            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__date c-typography__variant--h1" data-uid="68b86deb0c9c8">
    3
</span>            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__month c-typography__variant--h4" data-uid="68b86deb0c9f7">
    Sep
</span>    </div>
            <div class="c-datebadge__time">
                <!-- icon.blade.php -->
    <span class="c-icon c-icon--access-time c-icon--material c-icon--material-access_time material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined  c-icon--size-inherit" data-material-symbol="access_time" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" aria-hidden="false" data-uid="68b86deb0cb45">
                    </span>
                <!-- typography.blade.php   original: span -->
<span class="c-typography c-typography__variant--meta" data-uid="68b86deb0cba1">
    16:33
</span>        </div>
    </div>
@datebadge([
    'date' => date("Y-m-d H:i:s"),
    'includeTime' => true
])
@enddatebadge

Datebadge with time, small variant

3 Sep
16:33
<!-- datebadge.blade.php -->
<div class="c-datebadge c-datebadge--sm" data-uid="68b86deb0cc20">
    <div class="c-datebadge__daymonth">
            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__date c-typography__variant--h1" data-uid="68b86deb0cc50">
    3
</span>            <!-- typography.blade.php   original: span -->
<span class="c-typography c-datebadge__month c-typography__variant--h4" data-uid="68b86deb0cc81">
    Sep
</span>    </div>
            <div class="c-datebadge__time">
                <!-- icon.blade.php -->
    <span class="c-icon c-icon--access-time c-icon--material c-icon--material-access_time material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined  c-icon--size-inherit" data-material-symbol="access_time" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" aria-hidden="false" data-uid="68b86deb0ccba">
                    </span>
                <!-- typography.blade.php   original: span -->
<span class="c-typography c-typography__variant--meta" data-uid="68b86deb0ccf6">
    16:33
</span>        </div>
    </div>
@datebadge([
    'date' => date("Y-m-d H:i:s"),
    'includeTime' => true,
    'size' => 'sm'
])
@enddatebadge

Blade component parameters

Key Default value Type Available values Description
date false boolean - A date string in any format or a unix timestamp.
includeTime false boolean - Will add a box with timestamp below the date.
size md string - The size of the datebadge. Can be either 'sm' or 'md'.
id string - The DOM id of the component.
classList [] array - Array containing wrapping classes array
attributeList [] array - Array containing keys and values rendered as attributes
containerAware false boolean true/false Makes the component container aware. Appends modifiers --size--xs/sm/md/lg to the component.
Settings location: /var/www/webroot/ROOT/vendor/helsingborg-stad/component-library/source/php/Component/Datebadge/datebadge.json