-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
52 lines (50 loc) · 1.19 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Calculatrice de grossesse</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<div>
<h1>Calendar</h1>
<div class="calendar">
<div v-for="(week, index) in calendar" :key="index" class="week">
<div v-for="(day, index) in week" :key="index" class="day">
<div class="date">{{ day }}</div>
</div>
</div>
</div>
</div>
</div>
<script>
new Vue({
el: '#app',
data: {
lastPeriodDate: '',
conceptionDate: '',
showResults: false,
AndurationInDays: null,
},
mounted() {
this.generateCalendar();
},
methods: {
generateCalendar() {
let startDate = new Date(this.currentDate);
startDate.setDate(startDate.getDate() - startDate.getDay());
for (let i = 0; i < 39; i++) {
let week = [];
for (let j = 0; j < 7; j++) {
week.push(startDate.getDate());
startDate.setDate(startDate.getDate() + 1);
}
this.calendar.push(week);
}
}
},
});
</script>
</body>
</html>