21 lines
407 B
HTML
21 lines
407 B
HTML
<html>
|
|
<head>
|
|
<script src="./js/dayjs.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function test(){
|
|
const date1 = dayjs('2024-04-14')
|
|
date3 = date1.add(1, 'day')
|
|
const date2 = dayjs('2024-01-15')
|
|
date3.diff(date2) // 20214000000 default milliseconds
|
|
alert(date3.diff(date2,'month',true));
|
|
}
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<button onclick="test();">Click me</button>
|
|
|
|
</body>
|
|
</html> |