1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

forum: fix PostStream dates with dayjs in between long periods of time

This commit is contained in:
David Sevilla Martin
2020-03-28 09:11:17 -04:00
parent dbc3aac14e
commit 8a07bb68f6
4 changed files with 320 additions and 44 deletions

View File

@@ -11,7 +11,7 @@
* @param element The element to anchor the scroll position to.
* @param callback The callback to run that will change page content.
*/
export default function anchorScroll(element: HTMLElement, callback: Function) {
export default function anchorScroll(element: ZeptoCollection | HTMLElement, callback: Function) {
const $window = $(window);
const $el = $(element);

View File

@@ -1,3 +1,6 @@
import app from '../app';
import { Attributes } from 'mithril';
import Component from '../../common/Component';
import ScrollListener from '../../common/utils/ScrollListener';
import PostLoading from './LoadingPost';
@@ -8,7 +11,6 @@ import Discussion from '../../common/models/Discussion';
import Post from '../../common/models/Post';
import Evented from '../../common/utils/Evented';
import { DiscussionProp } from '../../common/concerns/ComponentProps';
import { Attributes } from 'mithril';
export interface PostStreamProps extends DiscussionProp {
includedPosts: Post[];
@@ -231,7 +233,7 @@ class PostStream<T extends PostStreamProps = PostStreamProps> extends Component<
content = [
<div className="PostStream-timeGap">
<span>
{app.translator.trans('core.forum.post_stream.time_lapsed_text', { period: dayjs(time).from(dayjs(lastTime, true)) })}
{app.translator.trans('core.forum.post_stream.time_lapsed_text', { period: dayjs(time).from(dayjs(lastTime), true) })}
</span>
</div>,
content,