• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Microsoft To-Do (wunderlist replacement?)

Scheduled Pinned Locked Moved Unsolved Requests
45 Posts 17 Posters 20.2k Views 19 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    smoysauce
    last edited by May 4, 2020, 1:08 PM

    @thobach: Do you have recommendations to get the due date to show? I have tried to add element.dueDateTime.dateTime in the MMM-MicrosoftToDo.js like I have in the past, but now the module won’t show with that that. And no matter how I try to format it with moment it still doesn’t like it. I tried it with the simple element.id to see if that would show and it does show the todo ID. Thoughts? I know I am missing something simple. Thanks!

    L 1 Reply Last reply May 4, 2020, 1:51 PM Reply Quote 0
    • L Offline
      lavolp3 Module Developer @smoysauce
      last edited by lavolp3 May 4, 2020, 1:52 PM May 4, 2020, 1:51 PM

      @smoysauce if your element does not have a dueDateTime (null) this could lead to an error (cannot get property of undefined).

      Maybe something like this?

      if (element.dueDateTime) {
        var dueDate = moment(element.dueDateTime.dateTime).format("LL");
      }
      

      How to troubleshoot modules
      MMM-soccer v2, MMM-AVStock

      S 2 Replies Last reply May 4, 2020, 3:11 PM Reply Quote 0
      • S Offline
        smoysauce @lavolp3
        last edited by May 4, 2020, 3:11 PM

        @lavolp3 Oh good call-out! I tried your example as well as a few other tweaks but it doesn’t seem to like it when I add that snippet in. I don’t know why it’s being so weird. I’ll keep toying around with it, but any other thoughts would be appreciated!

        1 Reply Last reply Reply Quote 0
        • S Offline
          smoysauce @lavolp3
          last edited by May 4, 2020, 8:58 PM

          @lavolp3 said in Microsoft To-Do (wunderlist replacement?):

          if (element.dueDateTime) {
          var dueDate = moment(element.dueDateTime.dateTime).format(“LL”);
          }

          So after some tinkering, I figured out that the node.js was not pulling in the due date so I removed the ‘select’ filter so the call URL has '/tasks?$top='

          After that, I was able to add moment(new Date(element.dueDateTime.dateTime)).format("ddd MMM DD") to the output string and got the date to show. But for the life of me, I cannot get the var or if statements to work. If I try to use either the module doesn’t load. I have tried them in all different spots and it just doesn’t like it.

          L 1 Reply Last reply May 4, 2020, 9:38 PM Reply Quote 0
          • L Offline
            lavolp3 Module Developer @smoysauce
            last edited by May 4, 2020, 9:38 PM

            @smoysauce
            First, moment(new Date(element.dueDateTime.dateTime)).format("ddd MMM DD") is redundant. You don’t need the new Date part.
            moment(element.dueDateTime.dateTime).format("ddd MMM DD")should be enough.

            Second, where have you put it?
            I had my own problems with the code, that’s why I’m working on an own version including due dates, but it’s not finished.

            Here’s how I would try to include it.

            if (this.list.length !== 0) {
                  this.list.forEach(element => (listItemsText += '<li style="list-style-position:inside; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">' + checkbox + element.subject + ((element.dueDate) ? moment(element.dueDateTime.dateTime).format("ddd MMM DD") : '') + '</li>'))
                } else {
                  // otherwise indicate that there are no list entries
                  listItemsText += '<li style="list-style-position:inside; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">' + this.translate('NO_ENTRIES') + '</li>'
                }
            

            How to troubleshoot modules
            MMM-soccer v2, MMM-AVStock

            S 1 Reply Last reply May 4, 2020, 10:07 PM Reply Quote 0
            • S Offline
              smoysauce @lavolp3
              last edited by May 4, 2020, 10:07 PM

              @lavolp3 said in Microsoft To-Do (wunderlist replacement?):

              if (this.list.length !== 0) {
              this.list.forEach(element => (listItemsText += ‘

            • ’ + checkbox + element.subject + ((element.dueDate) ? moment(element.dueDateTime.dateTime).format(“ddd MMM DD”) : ‘’) + ‘
            • ’))
              } else {
              // otherwise indicate that there are no list entries
              listItemsText += ‘
            • ’ + this.translate(‘NO_ENTRIES’) + ‘
            • ’
              }

              Thanks for pointing that out, I am still figuring things out and piecing things together and if they work I just stick with it! That snippet worked, I had to change the section element.dueDate to element.dueDateTime but other than that seems to be doing the trick. I’ll probably toy around with it a bit more to see if I can learn formatting it with CSS to left align the subject and right align the date. Thanks for the help and tips!

              1 Reply Last reply Reply Quote 0
              • O Offline
                open_book
                last edited by Sep 15, 2020, 11:00 AM

                @thobach thanks for your effort. Just got this up and running from your instructions in the README. Very pleased. :thumbs_up:

                sudo insert motivational.quote

                1 Reply Last reply Reply Quote 0
                • M Offline
                  Mighty Mouseq @thobach
                  last edited by Mighty Mouseq Oct 20, 2020, 7:28 PM Oct 20, 2020, 7:27 PM

                  @thobach said in Microsoft To-Do (wunderlist replacement?):

                  I don’t plan to implement a fade-option, sorry, it would require quite some effort given the current implementation.

                  I have been able to add a fade-option by looking at how this option has been implemented in the MMM-nstreinen module by @qistoph. Since I am not familiair with JS coding I don’t know wether it has been coded as it should.

                  My addition takes two parameters from config.js: ‘fade’, which can be true or false and ‘fadePoint’, which takes a decimal value between 0 and 1 and marks the point where the fade starts.

                  I added the code after the listItem styling.

                  // needed for the fade effect
                          itemCounter += 1
                          
                          // Create fade effect.
                          if (self.config.fade && self.config.fadePoint < 1) {
                            if (self.config.fadePoint < 0) {
                  	          self.config.fadePoint = 0;
                  	        }
                  	        var startingPoint = self.config.itemLimit * self.config.fadePoint;
                  	        var steps = self.config.itemLimit - startingPoint;
                  	        if (itemCounter >= startingPoint) {
                              var currentStep = itemCounter - startingPoint;
                              listItem.style.opacity = 1 - (1 / steps * currentStep);
                            }    
                          }
                  
                  T 1 Reply Last reply Oct 25, 2020, 9:41 AM Reply Quote 0
                  • T Offline
                    thobach @Mighty Mouseq
                    last edited by Oct 25, 2020, 9:41 AM

                    @Mighty-Mouseq Nice! Do you want to create a pull request? I could then merge it into the main branch for everyone.

                    M 2 Replies Last reply Oct 26, 2020, 9:11 AM Reply Quote 0
                    • M Offline
                      Mighty Mouseq @thobach
                      last edited by Oct 26, 2020, 9:11 AM

                      @thobach I do not consider myself a developer :-). I do not even have a GitHub account. If you prefer to implement this change through a pull request then I will have a look at the process. For such a minor change it might be a lot easier if you, or another developer, added the code in your repository.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 4 / 5
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy