Monatsberechnung javascript
This commit is contained in:
parent
ac60d94932
commit
ba7ae70fd2
21
test.html
Normal file
21
test.html
Normal file
@ -0,0 +1,21 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src=" https://cdn.jsdelivr.net/npm/dayjs@1.11.10/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>
|
Loading…
x
Reference in New Issue
Block a user