Hello,
i’m working on the MMM-Todoist from @cbrooker
https://forum.magicmirror.builders/topic/566/mmm-todoist-your-todoist-tasks-on-your-mirror
A good way to learn - Im trying to add the priority (want an icon and sort by) the due date and some little informations.
i found in the fetcher how to add the informations (in an array?) - but i dont really understand how the data are used after
for (var i = 0; i < JSON.parse(body).items.length; i++) {
if (JSON.parse(body).items[i].project_id == listID) {
items.push(JSON.parse(body).items[i].due_date_utc);
items.push(JSON.parse(body).items[i].priority);
items.push(JSON.parse(body).items[i].assigned_by_uid);
items.push(JSON.parse(body).items[i].content);
items.push(JSON.parse(body).items[i].checked);
and after i understand in the MMM-Todoist.js here
for (var i = 0; i < todos.length; i++) {
var titleWrapper = document.createElement(“tr”);
titleWrapper.innerHTML = todos[i];
titleWrapper.className = “title bright”;
wrapper.appendChild(titleWrapper);
// Create fade effect by MichMich (MIT)
if (this.config.fade && this.config.fadePoint < 1) {
if (this.config.fadePoint < 0) {
this.config.fadePoint = 0;
}
var startingPoint = todos.length * this.config.fadePoint;
var steps = todos.length - startingPoint;
if (i >= startingPoint) {
var currentStep = i - startingPoint;
titleWrapper.style.opacity = 1 - (1 / steps * currentStep);
we make the view
for now i have that - if someone can help me to understand - thankssssss