Advertisement
dhniceday

Daily Template

Jan 14th, 2023
1,693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. aliases:
  3. tags: ['daily']
  4. date-created:
  5. date-modified:
  6. title: <% tp.file.title %>
  7.  
  8. gesundheit:
  9.   schritte:
  10.   wasser:
  11.   schlafdauer:
  12.   schlafquali:
  13. ---
  14.  
  15. <%*
  16. const {getEvents} = this.app.plugins.plugins["google-calendar"].api;
  17.  
  18. const file = await tp.file.title;
  19. const events = await getEvents({ startDate: window.moment(file) });
  20.  
  21. var eventsString = await events.reduce((text, event) => text +=`- [ ] ${moment(event.start.dateTime).format("HH:mm")} ${event.summary} \n`, "");
  22. eventsString = eventsString.replace(/\|/g, '-');
  23. %>
  24.  
  25. # <% tp.file.title %>
  26.  
  27. ## Health
  28.  
  29. ```dataviewjs
  30. var schritte = dv.current().gesundheit.schritte;
  31. var wasser= dv.current().gesundheit.wasser
  32. var dauer = dv.current().gesundheit.schlafdauer;
  33. var index = dv.current().gesundheit.schlafquali;
  34.  
  35. var rDauer = 0;
  36. var goals = '';
  37.  
  38. if (schritte == null) {schritte='-';}
  39. if (wasser == null) {wasser='-';}
  40. if (dauer == null) {
  41.     dauer = '-';
  42. } else {
  43.     dauer = Math.round(dauer / 60 * 10) / 10;
  44. }
  45. if (index == null) {index='-';}
  46.  
  47. goals = `*Schritte*: **${schritte}**
  48. *Wasser:* **${wasser}** Gläser
  49. *Schlafen:* **${dauer}** Stunden (**${index}**)`;
  50.  
  51. dv.paragraph(goals);
  52. ```
  53.  
  54. ## Journal
  55.  
  56. ## Ideas
  57.  
  58. ## Day Planner
  59. <%`${eventsString}`%>
  60.  
  61. ## To Do
  62.  
  63. ## Backlinks
  64.  
  65. ```dataview
  66. LIST
  67. FROM [[<% tp.file.title %>]]
  68. WHERE !contains(tags, "waypoint")
  69. AND !contains(file.name, "_")
  70. AND !contains(file.name, "+")
  71. AND !contains(file.name, "%")
  72. AND !contains(file.path, "Daily Notes")
  73. ```
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement