Small fixes
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import express from 'express'
|
||||
import bodyParser from 'body-parser';
|
||||
import distanceInWordsToNow from 'date-fns/distance_in_words_to_now';
|
||||
import parseDate from 'date-fns/format';
|
||||
import moment from 'moment';
|
||||
|
||||
var hr = require('date-fns/locale/hr');
|
||||
|
||||
var MongoClient = require('mongodb').MongoClient;
|
||||
@@ -218,6 +221,7 @@ router.get('/search/listings', async (req, res, next) => {
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
|
||||
res.json(all.map(({_id,
|
||||
address,
|
||||
images,
|
||||
@@ -233,9 +237,10 @@ router.get('/search/listings', async (req, res, next) => {
|
||||
rooms,
|
||||
size,
|
||||
time: distanceInWordsToNow(
|
||||
new Date(time),
|
||||
{locale: hr}
|
||||
)
|
||||
moment(time, 'DD.MM.YYYY'),
|
||||
{locale: hr}
|
||||
),
|
||||
realTime: time
|
||||
})));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user