const date = new Date();
const time = Math.floor(date.getTime() / 1000);
const $1day = 24 * 60 * 60;
const filtered = alles.filter(async (entry) => {
if (await entry.last_seen.time !== undefined) {
return await entry.last_seen.time > (time - $1day);
}
return false;
});
Array.prototype.filter()
не подходит const filtered = array.filter(entry => (entry.last_seen.time > (time - $1day)));
entry.last_seen.time
time
- undefined $1day = 86400
function time() {
return parseInt(new Date().getTime()/1000)
}
time() - $1day
//html
<div class="success_alert"></div>
//css
<style>
.success_alert {
display: none;
}
</style>
<script>
$('success_alert').show()
$('success_alert').text(`Заявка успешно отправлена!`)
</script>