-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] add current date or time in result #286
Comments
this is (if I understand it correctly) the same as #269, but a bit more specific to date. |
no problem from modal forms
from quick add const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('LOG');
return result.asString('{{type}} {{log}} [[{{lien}}]]'); |
I found something from #269 and the quick add documentation: from modal form{ from quickadd const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('LOG');
const temps = window.moment().format("HH:mm");
return result.asString('{{type}} ||')+ temps + result.asString('|| {{log}} {{lien}} \n'); the result: log:: ☑📡 ||09:04|| my text [[path/to/my note.md|my note]] |
That is is correct code. When I get back to home later I will provide you a
simpler version if you like it
El vie, 28 jun 2024, 13:26, louwelyn-jeremy ***@***.***>
escribió:
… I found something from #269
<#269> and the
quick add documentation:
in can use a function in quick add to find the actual hour with
window.moment().format("HH:mm");
this my code now (i make some change)
from modal form
{
"title": "ajouter un log journalier",
"name": "LOG",
"fields": [
{
"name": "type",
"label": "type de log",
"description": "Séléctionner le type de log",
"isRequired": true,
"input": {
"type": "select",
"source": "fixed",
"options": [
{
"value": "log:: ☑💼",
"label": "Projet"
},
{
"value": "log:: ☑📡",
"label": "Perimetre"
}
]
}
},
{
"name": "log",
"label": "info",
"description": "indiquer ici l'information à noter",
"isRequired": true,
"input": {
"type": "text"
}
},
{
"name": "lien",
"label": "en rapport avec",
"description": "choisir le projet, le périmètre",
"isRequired": false,
"input": {
"type": "dataview",
"query": "dv.pages('"KMS_jeremy/GTD/GTD-Dom. resp" or
"KMS_jeremy/GTD/GTD-objectifs"or "KMS_jeremy/GTD/GTD-projets"').file.link"
}
}
],
"version": "1",
"template": {
"createCommand": true,
"parsedTemplate": []
}
}
from quickadd
const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('LOG');
const temps = window.moment().format("HH:mm");
return result.asString('{{type}} ||')+ temps + result.asString('|| {{log}} {{lien}} \n');
the result:
log:: ☑📡 ||09:04|| my text [[path/to/my note.md|my note]]
—
Reply to this email directly, view it on GitHub
<#286 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARKJWP2KRRHBIKFT6OBR43ZJVB5HAVCNFSM6AAAAABJ3VEAOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJWGY4DEMBTGQ>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
So, you can write that code like this, using a single javascript template string const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('LOG');
const temps = window.moment().format("HH:mm");
return result.asString(`{{type}} || ${temps} || {{log}} {{lien}} \n`); I feel really tempted to document this under advanced usecases. |
You can close the issue, thank you. |
No worries, we've all been there |
thank you for your work!
i have an issue with this plugin for make log to my journal.
i use Quick addand i can add log like this one:
log:: ☑📡 my text [[link to project]]
but i want to add the current time ... how can i do that ?
The text was updated successfully, but these errors were encountered: