Date

Format a date

Returns formatted date

Returns a globally set format of a date

<time class="2020-01-01 17:25:43">Wed 01 Jan 2020</time>
@date([
    'action' => 'formatDate',
    'timestamp' => '2020-01-01 17:25:43'
])
@enddate

Time Since

Returns time since a specified date

Returns the time since a given date

<span 
        id="61efb9319fd0f" 
    class="c-tooltip c-tooltip__top"
    js-bind-hover="tooltip" data-title="Wed 01 Jan 2020" role="tooltip" aria-label="Tooltip: Wed 01 Jan 2020" data-uid="61efb9319fd09"
    >
     <time class="2020-01-01 17:25:43">2 years</time> 
</span>
@date([
    'action' => 'timesince',
    'timestamp' => '2020-01-01 17:25:43'
])
@enddate

Time Until

Returns time until a specified date

Returns time until a specified date

<span 
        id="61efb931a0052" 
    class="c-tooltip c-tooltip__top"
    js-bind-hover="tooltip" data-title="Sun 30 Jan 2022" role="tooltip" aria-label="Tooltip: Sun 30 Jan 2022" data-uid="61efb931a004c"
    >
     <time class="2022-01-30 00:00:00">4 days</time> 
</span>
@date([
    'action' => 'timeuntil',
    'timestamp' => date('Y-m-d', strtotime(' + 5 days'))
])
@enddate

Blade component parameters

Key Default value Type Available values Description
date 24/12/2019 string - The date
time_since false boolean - Will return the date since.
time_since_cap 6 months string - How long back to spell out time since
format D d M Y string - Present date's in this format. Default: D d M Y
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: /mnt/persist/www/docroot_styleguide_v2/source/library/source/php/Component/Date/date.json