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:
@@ -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);
|
||||
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user