Skip to content

Releases: indieweb/date-formatter-php

Adds `formatTime()` function

Choose a tag to compare

@aaronpk aaronpk released this 05 Apr 15:15

New formatTime() function will render only the time portion of the start/end times.

Also fixes a bug where a start/end time containing only a date of the same day would render as "Apr 4-4, 2016"

Support custom class names in output HTML

Choose a tag to compare

@aaronpk aaronpk released this 01 Jan 21:51

Now you can customize the class names that are used in the HTML output:

echo IndieWeb\DateFormatter::format('2013-10-08T07:00:00-0700', '2013-10-08T08:50:00-0700', 'dt-departure', 'dt-arrival');
<time class="dt-departure" datetime="2013-10-08T07:00:00-07:00">
  October 8, 2013 from 7:00am
</time>
to
<time class="dt-arrival" datetime="2013-10-08T8:50:00-07:00">
  8:50am (-0700)
</time>

Support DateTime objects as input

Choose a tag to compare

@aaronpk aaronpk released this 28 Oct 00:33

Format function now accepts DateTime objects as input in addition to strings.

0.1.5 - Show timezone when start and end timezone are different

Choose a tag to compare

@aaronpk aaronpk released this 27 Oct 23:47

Shows the timezone when start and end timezone are different