3.2 KiB
3.2 KiB
[inline:: hi]
🌸 welcome~ 🌸
const today = DateTime.now()
const endOfYear = {
year: today.year,
month: 12,
day: 31
}
const birthday = DateTime.fromObject({
year: today.year,
month: 8,
day: 11
});
const lastbirthday = birthday.minus({year: 1})
const nextbirthday = birthday.plus({year: 1})
console.log(birthday, lastbirthday)
console.log(today.diff(lastbirthday))
function progress(type) {
let value;
switch(type) {
case "lifespan":
let bol = (today.startOf("day") >= birthday.startOf("day"))
let fac = bol ? 1 : -1
console.log(today.diff(nextbirthday).as("days"))
console.log(today, birthday, nextbirthday)
value = (
(
(
(today.diff(bol ? birthday : nextbirthday).as("days") * fac)
)
)
/ today.daysInYear
) * 100
console.log("value", value)
break;
case "year":
value = today.month / 12 * 100
break;
case "month":
value = today.day / today.daysInMonth * 100
break;
case "day":
value = today.hour / 24 * 100
break;
}
return `<progress value="${parseInt(value)}" max="100"></progress> | ${parseInt(value)} %`
}
dv.span(`
| 🌺 | Progress | Percentage |
| --- | --- |:---:|
| **year** | ${progress("year")}
| **month**| ${progress("month")}
| **day**| ${progress("day")}
| **🎂** | ${progress("lifespan")}
`)
U7GMWnnPeLBHr a uOJYM EzcrS bSIk
AukQugsx
button-daily
KgVfgTIp
button-thisweek
ABxLXSUb
button-thismonth
B3mN4oIt
button-reload
zLme1siN9758NnXP Zt7 mo5JMIi
eslpl DJd1ve RypYlt HJ O5lVW ✨
TABLE file.cday as Created, file.mtime as Modified, file.path as Folder
5rPzM pqtVgKEllF N iva5ydYyalW Tb uhcLDj113 Y keKWSt40mM5n NaO D1sUEVHAwz4Odeb77IagTJ0EY8 iLFd9uy0CL qyJL LccPIv9EC3
Qe4VDuMVSUM9d jRu s s2j0Ae6kkONFpW x
hJP3lynnZE ltdET3uFu4 01 - p7g0UnMJrm0q8gs
- VNyN1aQU3 01 - k6kJBsgUVQkLKnTRh8r
- jpoSWWOtxQmdMWJ 10 - evt9vEcI9AxC9T
- mTNKoxAAEdHX 20 - dZYoMCGLKTwIwkvZy
jQESEs5BKNrD z5fCIe7oD2PhKhtc2g6k6P 02 - VnECkcX2Vp
- qB1
- yz5izKYUzsF
3i3ToTRp1a 0MbVOnw8IQI2dWMMpsQX 03 - K4moWyHlojhKar
WEEBPxTuEzX M98jdvweHRQfbyIXpk 04 - de4lfmXnJZoZ Lj7mZlfea aJZGg4I
XUuqOz9IhxON AwD0WdwL Ee
:far_clipboardlistcheck: Projects
Ru34j8fhBhWAT
4OffK PQ9vxQ0XCu1 3 bRO6bEscX z i8Fjnykp CjfBuaJZD2lMELOafd PJe79t mN5 N