We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b556c9c commit bc2838eCopy full SHA for bc2838e
src/components/Card/Card.tsx
@@ -7,9 +7,15 @@ import Prose from '../Prose/Prose';
7
import { Props as Tag } from '../Tag';
8
import { TagList } from '../TagList';
9
const Time = (props: { value: Date }) => {
10
+ const currentDate = new Date(Date.now());
11
+ const isCurrent =
12
+ props.value.getMonth() === currentDate.getMonth() &&
13
+ props.value.getFullYear() === currentDate.getFullYear();
14
const formattedValue = formatDate(props.value);
15
const stringValue = props.value.toDateString();
- return <time dateTime={stringValue}>{formattedValue}</time>;
16
+ return (
17
+ <time dateTime={stringValue}>{isCurrent ? 'Present' : formattedValue}</time>
18
+ );
19
};
20
21
const Duration = (props: { start: Date; end: Date }) => (
0 commit comments