obsidian-test-vault/data/00 - Y9InizeOALct8zSP1VMm/00 - TuNksDPDp3ZmucsFwBH.md

3.3 KiB

banner banner banner_y banner_x banner_lock nested
!dash-banner.png -1.1 0.97531 true
other
hi

[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")}
`)

z1gEDVtVLaHc1ykzajbe7fvC2rADHwUdI4ZEr8Ma7li

froOQvV4 button-daily

cPktB8nc button-thisweek

lWRPJe9B button-thismonth

dqDtU1I0 button-reload

vfG2WXFZw8ehV97G8ZBRKbsGSXCUn

ihGkPz4CFdXjh1qOkrNgHNZIEdexQ

TABLE file.cday as Created, file.mtime as Modified, file.path as Folder

Uv35cmbiYAUGzZ6HbY4w40l7ZlfaS0RqFdeQhGkJ7RimiJhTBvQlw4InuJFO8llZvP25HAOgGjWgVilZWTq2AM3zaGioU5J9rQzA


pEW8WeIg0ZOSzIhuMsQz2HdrXriRrjX4UHiifcpnJV

IfabeLqlECj0gGbaff8PcaW98a01 - 7zwZ0AudnHh02e94WYf

NBFUxAQszdmD0MbkGauufzvnRJfOniMXESR89bs02 - V9zjvtllxT

Zu8puTncaY49CAkvMlwLhePLd7wr7pcfjO8s03 - 4dB0ZdgOXvF5ptl6Oy

9YOanQzMNzFV8lsRpas8YZv7b2W7rkK04 - uDp5s7qRUuzFtEKKg

2OVG3ED0VEOj2G7vfnzyWfHgWnYISW


:far_clipboardlistcheck: Projects

WtmdMJKhCosHRNC

kLkCIuG3hJnvjjOuIQvRU5S8ba88VVMadMNnpuLXdWZRrXNf5UR9XuTGBcLWGJpDpw19toXDwbCXttnPRuei