提交 77517976 编写于 作者: D Dmitry Sharshakov 提交者: Eric Amodio

Display future events in timeline correctly

上级 00883d2e
......@@ -19,7 +19,9 @@ export function fromNow(date: number | Date, appendAgoLabel?: boolean): string {
}
const seconds = Math.round((new Date().getTime() - date) / 1000);
if (seconds < 30) {
if (seconds < -30) {
return `in ${fromNow(new Date().getTime() + seconds * 1000, false)}`;
} else if (seconds < 30) {
return localize('date.fromNow.now', 'now');
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册