mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-01-19 22:22:53 -05:00
[Glitch] Fix <RelativeTimestamp>
types
Port 961bb84e4c87555bbce930a87291938a988a483a to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
0ab212f6a9
commit
cc720cd38f
@ -191,7 +191,7 @@ const timeRemainingString = (
|
||||
interface Props {
|
||||
intl: IntlShape;
|
||||
timestamp: string;
|
||||
year: number;
|
||||
year?: number;
|
||||
futureDate?: boolean;
|
||||
short?: boolean;
|
||||
}
|
||||
@ -203,11 +203,6 @@ class RelativeTimestamp extends Component<Props, States> {
|
||||
now: Date.now(),
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
year: new Date().getFullYear(),
|
||||
short: true,
|
||||
};
|
||||
|
||||
_timer: number | undefined;
|
||||
|
||||
shouldComponentUpdate(nextProps: Props, nextState: States) {
|
||||
@ -257,7 +252,13 @@ class RelativeTimestamp extends Component<Props, States> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { timestamp, intl, year, futureDate, short } = this.props;
|
||||
const {
|
||||
timestamp,
|
||||
intl,
|
||||
futureDate,
|
||||
year = new Date().getFullYear(),
|
||||
short = true,
|
||||
} = this.props;
|
||||
|
||||
const timeGiven = timestamp.includes('T');
|
||||
const date = new Date(timestamp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user