mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Updated Weight tracker (markdown)
parent
ab6e71850b
commit
b4abcfe659
@ -21,12 +21,12 @@ To get an idea of the script, here's the "JS code" note content:
|
|||||||
```javascript
|
```javascript
|
||||||
async function getChartData() {
|
async function getChartData() {
|
||||||
const days = await api.runOnBackend(async () => {
|
const days = await api.runOnBackend(async () => {
|
||||||
const notes = await api.getNotesWithLabel('weight');
|
const notes = api.getNotesWithLabel('weight');
|
||||||
const days = [];
|
const days = [];
|
||||||
|
|
||||||
for (const note of notes) {
|
for (const note of notes) {
|
||||||
const date = await note.getLabelValue('dateNote');
|
const date = note.getLabelValue('dateNote');
|
||||||
const weight = parseFloat(await note.getLabelValue('weight'));
|
const weight = parseFloat(note.getLabelValue('weight'));
|
||||||
|
|
||||||
if (date && weight) {
|
if (date && weight) {
|
||||||
days.push({ date, weight });
|
days.push({ date, weight });
|
Loading…
x
Reference in New Issue
Block a user