Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix timestamp bug
  • Loading branch information
PrinceSumberia committed Aug 13, 2021
commit 9c2ba392ab549716d6e1eac5177ae987843146dd
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/react-fontawesome": "^0.1.9",
"@material-ui/core": "^4.9.11",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.15",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.9.1",
"@material-ui/styles": "^4.9.10",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@material-ui/styles": "^4.11.4",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"axios": "^0.21.1",
"classnames": "^2.2.6",
"date-fns": "^2.13.0",
"react": "^16.13.1",
"react-content-loader": "^5.0.4",
"react-dom": "^16.13.1",
"react-fade-in": "^1.0.0",
"classnames": "^2.3.1",
"date-fns": "^2.23.0",
"react": "^17.0.2",
"react-content-loader": "^6.0.3",
"react-dom": "^17.0.2",
"react-fade-in": "^2.0.1",
"react-lottie": "^1.2.3",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.3",
"react-scripts": "^4.0.3",
"react-simple-maps": "^2.0.0",
"react-tooltip": "^4.2.5",
"recharts": "^1.8.5"
"react-tooltip": "^4.2.21",
"recharts": "^2.1.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
47 changes: 20 additions & 27 deletions src/components/CovidApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ const defaultOptions = {
},
};

const months = {
1: 'Jan',
2: 'Feb',
3: 'Mar',
4: 'Apr',
5: 'May',
6: 'Jun',
7: 'Jul',
8: 'Aug',
9: 'Sep',
10: 'Oct',
11: 'Nov',
12: 'Dec',
};
const months = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec',
];

class CovidApp extends Component {
constructor(props) {
Expand Down Expand Up @@ -145,24 +145,17 @@ class CovidApp extends Component {
try {
const [date, time] = timestamp.split(' ');
const formattedDate = date.split('/');
console.log(time);
return `${formattedDate[0]} ${months[formattedDate[1]]}, ${time.slice(
0,
5
)} IST`;

return `${formattedDate[0]} ${
months[Number(formattedDate[1]) - 1]
}, ${time.slice(0, 5)} IST`;
} catch (err) {}
}

render() {
const { classes, setDarkMode, isDarkMode } = this.props;
const {
mapData,
isLoading,
data,
districtLevel,
expanded,
updates,
} = this.state;
const { mapData, isLoading, data, districtLevel, expanded, updates } =
this.state;

if (isLoading) {
return (
Expand Down
Loading