let time = Date.parse('2018-00-01T00:00:00'); let date = new Date(); let now = date.getTime(); let result = now - time; result = result / (); alert(result);
let date = Date.parse(2018); let now = new Date(); let result = (now - date)/604800000; alert(result); alert(Math.floor(result)); // полных недель