-
Notifications
You must be signed in to change notification settings - Fork 0
/
year.html
27 lines (22 loc) · 1.01 KB
/
year.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
<!DOCTYPE html>
<html>
<body>
<script src="amlich-hnd.js"></script>
<script type="text/javascript">
function getDaysInYear(year) {
var result = {};
var currentDate = new Date(year, 0, 1); // January 1st of the specified year
// Loop through each day of the year
while (currentDate.getFullYear() == year) {
var date = new Date(currentDate);
currentDate.setDate(currentDate.getDate() + 1); // Move to the next day
const lunarDate = getLunarDate(date.getDate(), date.getMonth() + 1, date.getFullYear());
result[`${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`] = `${lunarDate.day}/${lunarDate.month} ${getYearCanChi(lunarDate.year)}`;
}
document.write(JSON.stringify(result));
}
var year = new Date().getFullYear();
getDaysInYear(year);
</script>
</body>
</html>