From 4ce65d59ca91871cfd126497158200a818720bce Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:30:08 +0200 Subject: Adding upstream version 0.13.1. Signed-off-by: Daniel Baumann --- vendor/ipl/web/src/Widget/TimeUntil.php | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 vendor/ipl/web/src/Widget/TimeUntil.php (limited to 'vendor/ipl/web/src/Widget/TimeUntil.php') diff --git a/vendor/ipl/web/src/Widget/TimeUntil.php b/vendor/ipl/web/src/Widget/TimeUntil.php new file mode 100644 index 0000000..f16731a --- /dev/null +++ b/vendor/ipl/web/src/Widget/TimeUntil.php @@ -0,0 +1,34 @@ + 'time-until']; + + public function __construct($until) + { + $this->until = (int) $until; + } + + protected function assemble() + { + $dateTime = DateFormatter::formatDateTime($this->until); + + $this->addAttributes([ + 'datetime' => $dateTime, + 'title' => $dateTime, + 'data-ago-label' => DateFormatter::timeAgo(time()) + ]); + + $this->add(DateFormatter::timeUntil($this->until)); + } +} -- cgit v1.2.3