Small fixes

This commit is contained in:
Edin Dazdarevic
2017-04-17 15:17:45 +02:00
parent a9664dbcc0
commit c556f52b1c
7 changed files with 788 additions and 16 deletions

View File

@@ -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
})));
}