mirror of
https://github.com/flarum/core.git
synced 2025-05-16 12:19:41 +02:00
parent
16b229649a
commit
dbbbc689bb
8
js/admin/dist/app.js
vendored
8
js/admin/dist/app.js
vendored
@ -22447,6 +22447,14 @@ System.register('flarum/utils/formatNumber', [], function (_export, _context) {
|
||||
System.register('flarum/utils/humanTime', [], function (_export, _context) {
|
||||
function humanTime(time) {
|
||||
var m = moment(time);
|
||||
var now = moment();
|
||||
|
||||
// To prevent showing things like "in a few seconds" due to small offsets
|
||||
// between client and server time, we always reset future dates to the
|
||||
// current time. This will result in "just now" being shown instead.
|
||||
if (m.isAfter(now)) {
|
||||
m = now;
|
||||
}
|
||||
|
||||
var day = 864e5;
|
||||
var diff = m.diff(moment());
|
||||
|
8
js/forum/dist/app.js
vendored
8
js/forum/dist/app.js
vendored
@ -30555,6 +30555,14 @@ System.register('flarum/utils/History', [], function (_export, _context) {
|
||||
System.register('flarum/utils/humanTime', [], function (_export, _context) {
|
||||
function humanTime(time) {
|
||||
var m = moment(time);
|
||||
var now = moment();
|
||||
|
||||
// To prevent showing things like "in a few seconds" due to small offsets
|
||||
// between client and server time, we always reset future dates to the
|
||||
// current time. This will result in "just now" being shown instead.
|
||||
if (m.isAfter(now)) {
|
||||
m = now;
|
||||
}
|
||||
|
||||
var day = 864e5;
|
||||
var diff = m.diff(moment());
|
||||
|
@ -6,7 +6,15 @@
|
||||
* @return {String}
|
||||
*/
|
||||
export default function humanTime(time) {
|
||||
const m = moment(time);
|
||||
let m = moment(time);
|
||||
const now = moment();
|
||||
|
||||
// To prevent showing things like "in a few seconds" due to small offsets
|
||||
// between client and server time, we always reset future dates to the
|
||||
// current time. This will result in "just now" being shown instead.
|
||||
if (m.isAfter(now)) {
|
||||
m = now;
|
||||
}
|
||||
|
||||
const day = 864e5;
|
||||
const diff = m.diff(moment());
|
||||
|
Loading…
x
Reference in New Issue
Block a user