mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: set time to zero when calculating remaining days
This commit is contained in:
@@ -62,7 +62,7 @@ export function TrackedDomainTable() {
|
|||||||
const notices: ReactElement[] = []
|
const notices: ReactElement[] = []
|
||||||
setDataTable(data['hydra:member'].map((d: Domain) => {
|
setDataTable(data['hydra:member'].map((d: Domain) => {
|
||||||
const expirationDate = d.events.find(e => e.action === 'expiration' && !e.deleted)?.date
|
const expirationDate = d.events.find(e => e.action === 'expiration' && !e.deleted)?.date
|
||||||
const expiresInDays = d.expiresInDays && d.expiresInDays > 0 ? -d.expiresInDays : undefined
|
const expiresInDays = d.expiresInDays && d.expiresInDays > 1 ? -d.expiresInDays : undefined
|
||||||
|
|
||||||
if (d.status.includes('redemption period')) {
|
if (d.status.includes('redemption period')) {
|
||||||
if (!notices.includes(REDEMPTION_NOTICE)) notices.push(REDEMPTION_NOTICE)
|
if (!notices.includes(REDEMPTION_NOTICE)) notices.push(REDEMPTION_NOTICE)
|
||||||
@@ -138,12 +138,12 @@ export function TrackedDomainTable() {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
d.expiresInDays && <Tooltip title={t`Estimated number of days until WHOIS removal`}>
|
d.expiresInDays ? <Tooltip title={t`Estimated number of days until WHOIS removal`}>
|
||||||
<Tag bordered={false}
|
<Tag bordered={false}
|
||||||
color={d.expiresInDays <= 5 ? 'red' : d.expiresInDays <= 35 ? 'orange' : 'default'}>
|
color={d.expiresInDays <= 5 ? 'red' : d.expiresInDays <= 35 ? 'orange' : 'default'}>
|
||||||
{t`J ${expiresInDays}`}
|
{t`J ${expiresInDays}`}
|
||||||
</Tag>
|
</Tag>
|
||||||
</Tooltip>
|
</Tooltip> : undefined
|
||||||
}
|
}
|
||||||
</Flex>
|
</Flex>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -468,6 +468,7 @@ class Domain
|
|||||||
#[Groups(['domain:item', 'domain:list'])]
|
#[Groups(['domain:item', 'domain:list'])]
|
||||||
public function getExpiresInDays(): ?int
|
public function getExpiresInDays(): ?int
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
$now = new \DateTimeImmutable();
|
$now = new \DateTimeImmutable();
|
||||||
$lastStatus = $this->getDomainStatuses()->last();
|
$lastStatus = $this->getDomainStatuses()->last();
|
||||||
$daysToExpiration = null;
|
$daysToExpiration = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user