kateFrontend / react-current-time

A simple React application showing your real current time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Current Time

cover

🦉 Main information

A simple React application showing your real current time.

The project goal:

  • create simple React application showing your current time;
  • use React class component;
  • create a new Date object for the current time;
  • use toLocaleDateString() method to return a string with a language-sensitive representation of the date portion of this date in the local timezone;
  • use componentDidMount() method to set interval;
  • use componentWillUnmount() method to clear interval;
  • add CSS to make it look nice;

🦊 Useful links

The JavaScript language - Data types

https://javascript.info/date

Date.prototype.toLocaleDateString()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString

UNSAFE_componentWillMount() method

https://react.dev/reference/react/Component#unsafe_componentwillmount

ComponentDidMount() method

https://react.dev/reference/react/Component#componentdidmount

⚡ Built With

React

About

A simple React application showing your real current time.


Languages

Language:JavaScript 60.9%Language:CSS 20.7%Language:HTML 18.4%