mirror of
https://github.com/koichixD/uptime-kuma.git
synced 2026-09-04 09:13:21 +00:00
feat: Domain name expiry (#6413)
Co-authored-by: AiroPi <47398145+AiroPi@users.noreply.github.com> Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
co-authored by
AiroPi
Frank Elsinga
parent
f3c76dbc6f
commit
eb0b6cdb09
@@ -483,6 +483,7 @@ exports.setSettings = async function (type, data) {
|
||||
*/
|
||||
const getDaysBetween = (validFrom, validTo) =>
|
||||
Math.round(Math.abs(+validFrom - +validTo) / 8.64e7);
|
||||
exports.getDaysBetween = getDaysBetween;
|
||||
|
||||
/**
|
||||
* Get days remaining from a time range
|
||||
@@ -492,11 +493,12 @@ const getDaysBetween = (validFrom, validTo) =>
|
||||
*/
|
||||
const getDaysRemaining = (validFrom, validTo) => {
|
||||
const daysRemaining = getDaysBetween(validFrom, validTo);
|
||||
if (new Date(validTo).getTime() < new Date().getTime()) {
|
||||
if (new Date(validTo).getTime() < new Date(validFrom).getTime()) {
|
||||
return -daysRemaining;
|
||||
}
|
||||
return daysRemaining;
|
||||
};
|
||||
exports.getDaysRemaining = getDaysRemaining;
|
||||
|
||||
/**
|
||||
* Fix certificate info for display
|
||||
|
||||
Reference in New Issue
Block a user