add months
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-top: 200px;
|
margin-top: 200px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 60pt;
|
font-size: 50pt;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: black;
|
color: black;
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
var calculate = function(){
|
var calculate = function(){
|
||||||
var start = moment("2015-07-02"),
|
var start = moment("2015-07-02"),
|
||||||
end = moment(),
|
end = moment(),
|
||||||
diff = end - start,
|
diff = end.diff(start),
|
||||||
duration = moment.duration(diff);
|
duration = moment.duration(diff);
|
||||||
var answer = duration.years() + " Years " + duration.days() + " Days " + duration.hours() + " Hours " + duration.minutes() + " Minutes " + duration.seconds() + " Seconds";
|
var answer = duration.years() + " Years " + duration.months() + " Months " + duration.days() + " Days " + duration.hours() + " Hours " + duration.minutes() + " Minutes " + duration.seconds() + " Seconds";
|
||||||
var elem = document.getElementById('answer');
|
var elem = document.getElementById('answer');
|
||||||
elem.innerHTML = answer;
|
elem.innerHTML = answer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user