Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Antd Countdown not working for a specific date

I’m trying to create a component to a specific date using react with antd. Here's my code:

import { Statistic, Col, Row } from 'antd';

const { Countdown } = Statistic;
const deadline = Date.parse('2022-12-31') - Date.now();

const Count = () => {
    return (
        <Countdown title="Countdown" value={deadline} format="DD:HH:mm:ss"/>
    )
}

The countdown just displays 00:00:00:00 when the timestamp has is a positive number. Any help is appreciated. Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The deadline passed to the <Countdown> component must be an absolute value (that is starting from epoch - Jan 1, 1970).

So you need to change it simply to:

const deadline = Date.parse('2022-12-31');

You can check this Stackblitz example for reference.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!