```dataviewjs let morning = [ "Let's do great work today!", "It's a new day!" ]; let afternoon = [ "Let's finish the day well!", "Let's keep our focus up!", "Remember to finish all the tasks!" ]; let evening = [ "Sleep Early.", "Don't leave anything unfinished." ]; const currentHour = moment().format('HH'); let greeting; if (currentHour >= 17 || currentHour < 5) { greeting = "🌙 Good Evening! " + evening[Math.floor(Math.random()*evening.length)]; } else if (currentHour >= 5 && currentHour < 12) { greeting = "🌞 Good Morning! " + morning[Math.floor(Math.random()*morning.length)]; } else { greeting = "🌞 Good Afternoon! " + afternoon[Math.floor(Math.random()*afternoon.length)]; } dv.header(4, greeting); ``` ```dataviewjs let ftMd = dv.pages("").file.sort(t => t.cday)[0] let total = parseInt([new Date() - ftMd.ctime] / (60*60*24*1000)) let totalDays = "You have been using *Obsidian* for "+total+" days," let nofold = '!"misc/templates"' let allFile = dv.pages(nofold).file let totalMd = " with "+ allFile.length+" notes, " let totalTag = allFile.etags.distinct().length+" tags, " let totalTask = allFile.tasks.length+" tasks created. " dv.paragraph( totalDays+totalMd+""+totalTag+""+totalTask ) ``` --- <div class="weather_current_4"></div> --- ```dataviewjs const today = DateTime.now() const endOfYear = { year: today.year, month: 12, day: 31 } const lifespan = { year: 80 } const birthday = DateTime.fromObject({ year: 1998, month: 8, day: 12 }); const deathday = birthday.plus(lifespan) function progress(type) { let value; switch(type) { case "lifespan": value = (today.year - birthday.year) / lifespan.year * 100; break; case "year": value = today.ordinal / today.daysInYear * 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")} | **Life** | ${progress("lifespan")} `) ``` # Keeping Tabs - Medical - [[Symptoms Tracker]] - [[Vitals Tracker]] - [[Medication Tracker]] - Health - [[Water Intake Tracker]] - [[Weight Tracker]] - Organiser - [[Task Manager]] # Personal Projects - POTS - [[Home]] - [[Kanban Zotero]] - [[8.3. Video Resources| YouTube Videos]] # Vault Info - 🗄️ Recent file updates `$=dv.list(dv.pages('').sort(f=>f.file.mtime.ts,"desc").limit(4).file.link)` - Tagged: favorite `$=dv.list(dv.pages('#favorite').sort(f=>f.file.name,"desc").limit(4).file.link)` - Stats - File Count: `$=dv.pages().length` - Daily Notes: `$=dv.pages('"Daily Notes"').length` --- ```dataviewjs let folderChoicePath = "Daily Notes" const files = app.vault.getMarkdownFiles().filter(file => file.path.includes(folderChoicePath)) let arr = files.map(async(file) => { const content = await app.vault.cachedRead(file) let lines = await content.split("\n").filter(line => line.includes("#fazit")) //console.log(lines) return [file.name.split(".")[0], lines] }) Promise.all(arr).then(values => { const beautify = values.map(value => { const temp = value[1].map(line => { return line.slice(6,) }) // slice off the tag, if you change the tag remember to change the number too. const formattedDate = "[[" + moment(value[0], "YYYY-MM-DD").format("YYYY-MM-DD") + "]]"; return [formattedDate, temp] }) const exists = beautify.filter(value => value[1][0]).slice(0,7).sort().reverse() dv.table(["Date", "Fazit"], exists) }) ``` ---