Data não aceita dias abaixo do dia 20
Olá! Estou com um pequeno problema, é o seguinte, quando tento colocar uma data abaixo do dia 20 na seguinte função abaixo (Parte em NEGRITO) ela não funciona.
O back-end anterior fez da seguinte forma:
(Dexei um arquivo com o código todo em anexo.)
function getTimeRemaining(endtime){
var t = Date.parse(endtime) - Date.parse(new Date());
return {
'total': t,
'days': Math.floor( t / (1000 * 60 * 60 * 24) ),
'hours': Math.floor( (t / (1000 * 60 * 60) ) % 24 ),
'minutes': Math.floor( (t / 1000 / 60) % 60 )
};
}
// City Selector
$(function () {
var events_informations = {
'belo-horizonte': {
'title': 'Belo Horizonte',
'date': '08/07/2017',
'place': 'Dayrell Hotel - a partir das 8:00',
'imagePath': 'img/cities/bh/belo-horizonte-2.jpg',
'btnBuyNow': 'https://www.sympla.com.br/',
'btnDestinePage': '/belo-horizonte',
'mapPlace': {lat: -19.9226186, lng: -43.9401089},
'datetime': 'June 20 2017 8:30:00 GMT-03:00'
}
};
function getNextDestines(events_informations) {
var nextDestines = [];
var keys = Object.keys(events_informations);
for (var i = 0; i < keys.length; i++) {
var today = new Date();
var date = new Date(events_informations[keys]['datetime']);
if (date.getTime() > today.getTime() && date.getDate() > today.getDate()) {
nextDestines = [events_informations[keys], events_informations[keys[i+1]], events_informations[keys[i+2]], events_informations[keys[i+3]]];
break;
}
}
return nextDestines;
};
*Será que vocês podem me ajudar nessa?*
Muito obrigado!
Discussão (8)
Carregando comentários...