Fix date in same day

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-12-08 21:52:25 +05:30
parent dde022d179
commit a70245a3b1
2 changed files with 2 additions and 5 deletions

View file

@ -90,6 +90,7 @@ class RoomTimeline extends EventEmitter {
} }
canPaginateBackward() { canPaginateBackward() {
if (this.timeline[0].getType() === 'm.room.create') return false;
const tm = getFirstLinkedTimeline(this.activeTimeline); const tm = getFirstLinkedTimeline(this.activeTimeline);
return tm.getPaginationToken('b') !== null; return tm.getPaginationToken('b') !== null;
} }

View file

@ -14,11 +14,7 @@ export function diffMinutes(dt2, dt1) {
} }
export function isInSameDay(dt2, dt1) { export function isInSameDay(dt2, dt1) {
return ( return (dt2.setHours(0, 0, 0, 0) === dt1.setHours(0, 0, 0, 0));
dt2.getDay() === dt1.getDay()
&& dt2.getMonth() === dt1.getMonth()
&& dt2.getYear() === dt1.getYear()
);
} }
export function getEventCords(ev) { export function getEventCords(ev) {