Skip to content

Commit a4115a7

Browse files
committed
update datatip date
1 parent 8c28a27 commit a4115a7

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/components/Table/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from './filters';
2424
import { Event } from '../Shared/Tracking';
2525

26-
import questions from '../../data';
26+
import questions, { updated } from '../../data';
2727

2828
import 'react-toggle/style.css';
2929
import './styles.scss';
@@ -353,13 +353,20 @@ const Table = () => {
353353
},
354354
{
355355
Header: () => {
356+
const date = new Date(updated);
357+
const month = date.toLocaleString('default', {
358+
month: 'long',
359+
});
360+
const year = date.getFullYear();
356361
return (
357362
<>
358363
<div
359364
style={{ whiteSpace: 'nowrap', display: 'inline-block' }}
360365
>
361366
Companies{' '}
362-
<span data-tip="Companies retrieved from Leetcode Premium (January 2022)">
367+
<span
368+
data-tip={`Companies retrieved from Leetcode Premium (${month} ${year})`}
369+
>
363370
<FaQuestionCircle />
364371
</span>
365372
</div>

src/data/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import questions from './questions.json';
22

33
const sortBy = { Easy: 0, Medium: 1, Hard: 2 };
4+
const { updated, data } = questions;
45

5-
export default questions.data.sort(
6-
(a, b) => sortBy[a.difficulty] - sortBy[b.difficulty],
7-
);
6+
export { updated };
7+
export default data.sort((a, b) => sortBy[a.difficulty] - sortBy[b.difficulty]);

0 commit comments

Comments
 (0)