fix(dav): Hide less than minute diff in calendar notification title

Signed-off-by: jld3103 <jld3103yt@gmail.com>
This commit is contained in:
jld3103 2023-12-20 18:29:57 +01:00 committed by backportbot-nextcloud[bot]
parent 42dee2e29f
commit 4da91f56e4

View file

@ -170,7 +170,7 @@ class Notifier implements INotifier {
$components[] = $this->l10n->n('%n minute', '%n minutes', $diff->i);
}
if (!$this->hasPhpDatetimeDiffBug()) {
if (count($components) > 0 && !$this->hasPhpDatetimeDiffBug()) {
// Limiting to the first three components to prevent
// the string from getting too long
$firstThreeComponents = array_slice($components, 0, 2);