mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:31:14 +08:00
FIX: Determining local date same range is erroring when there is no date (#18509)
This commit is contained in:
@ -58,6 +58,12 @@ export function applyLocalDates(dates, siteSettings) {
|
||||
}
|
||||
|
||||
function _rangeIsSameLocalDay(fromElement, toElement) {
|
||||
if (
|
||||
!fromElement.attributes["data-time"] ||
|
||||
!toElement.attributes["data-time"]
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
const timezone = fromElement.attributes["data-timezone"].value;
|
||||
const from = moment(_getDateFromElement(fromElement)).tz(timezone);
|
||||
const to = moment(_getDateFromElement(toElement)).tz(timezone);
|
||||
|
Reference in New Issue
Block a user