Commit a5c9e000 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Notifications] Don't show do not disturb end date beyond 100 days

When setting "until turned off" it effectively sets it to today in a year. Now with leap year this appears to have broken.
Instead, just use 100 days, which is plenty, even if we come up with a "for 1 month" option maybe.

Differential Revision: https://phabricator.kde.org/D28740
parent 77975468
......@@ -229,7 +229,7 @@ ColumnLayout{
var sections = [];
// Show until time if valid but not if too far int he future
if (!isNaN(inhibitedUntil.getTime()) && inhibitedUntil.getTime() - new Date().getTime() < 365 * 24 * 60 * 60 * 1000 /* 1 year*/) {
if (!isNaN(inhibitedUntil.getTime()) && inhibitedUntil.getTime() - new Date().getTime() < 100 * 24 * 60 * 60 * 1000 /* 100 days*/) {
sections.push(i18nc("Do not disturb until date", "Until %1",
KCoreAddons.Format.formatRelativeDateTime(inhibitedUntil, Locale.ShortFormat)));
}
......
......@@ -78,7 +78,7 @@ Item {
// Show until time if valid but not if too far in the future
// TODO check app inhibition, too
if (inhibitedUntilValid
&& inhibitedUntil.getTime() - new Date().getTime() < 365 * 24 * 60 * 60 * 1000 /* 1 year*/) {
&& inhibitedUntil.getTime() - new Date().getTime() < 100 * 24 * 60 * 60 * 1000 /* 100 days*/) {
lines.push(i18n("Do not disturb until %1",
KCoreAddons.Format.formatRelativeDateTime(inhibitedUntil, Locale.ShortFormat)));
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment