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.

    MMM-Chores - Manage and keep track of your household Chores

    Scheduled Pinned Locked Moved Utilities
    104 Posts 19 Posters 28.3k Views 20 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.
    • E Offline
      ewingfox
      last edited by sdetweil

      Hello! New user here, love the UI (especially the admin features!) I’m building a secret Christmas gift for my wife (who is obsessed with organization). I was about to give up on MM - until I found your module!

      Question: I see daily, weekly, monthly options - is there a feature to set reoccurring events that are Monday Friday? This is specific to kids who may have daily ‘weekday’ tasks to do that aren’t required on Saturday or Sunday. I’m happy to skip the UI - aka, create an event in the UI and then tweak the underlying config via CLI.

      Thank you!!!

      E
      EDIT:

      took a gander at your code (yeah, you are a pro - this is REALLY CLEAN (I’m a hack, but I know good work when I see it lol). Looks like an update to the getNextDate function, adding the pattern to the admin html file and the lang pack (I only added it to the enlish one (remember, hack here) seems to work pretty well. I’ll search a bit further and do a little testing to see how it behaves - but… a thing?

      E

      function getNextDate(dateStr, recurring) {
        const d = new Date(dateStr);
        if (recurring === "daily") {
          d.setDate(d.getDate() + 1);
        } else if (recurring === "weekly") {
          d.setDate(d.getDate() + 7);
        } else if (recurring === "monthly") {
          d.setMonth(d.getMonth() + 1);
        } else if (recurring === "yearly") {
          d.setFullYear(d.getFullYear() + 1);
        } else if (recurring && recurring.startsWith("every_")) {
          // Custom recurring patterns: every_X_days, every_X_weeks, first_monday_month
          const parts = recurring.split("_");
          if (parts[1] === "X" && parts[2] === "days") {
            const days = parseInt(parts[3]) || 2;
            d.setDate(d.getDate() + days);
          } else if (parts[1] === "X" && parts[2] === "weeks") {
            const weeks = parseInt(parts[3]) || 2;
            d.setDate(d.getDate() + (weeks * 7));
          } else if (recurring === "first_monday_month") {
            // First Monday of next month
            d.setMonth(d.getMonth() + 1);
            d.setDate(1);
            // Find first Monday
            while (d.getDay() !== 1) {
              d.setDate(d.getDate() + 1);
            }
          } else {
            return null;
          }
        } else {
          return null;
        }
        return d.toISOString().slice(0, 10);
      }
      

      34d49e4b-e53b-4fac-be14-3b4d6a278d73-image.png

      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @ewingfox
        last edited by

        @ewingfox please always code block for code, config and logs

        paste the text into the message editor window, blank line above and below
        select the text just pasted
        hit the </> button on the message editor toolbar

        I fixed prior

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        E 1 Reply Last reply Reply Quote 2
        • E Offline
          ewingfox @sdetweil
          last edited by

          @sdetweil - Thanks! I’m a total hack, so I appreciate the heads up. MUCH CLEANER. I’m not used to passing code blocks in chats, usually I’m in an SCM somewhere, causing trouble… giving my devs a headache… :D

          E 1 Reply Last reply Reply Quote 0
          • E Offline
            ewingfox @ewingfox
            last edited by

            I’ve done a lot of testing and submitted PR-220 . It turns out there are some really complicated date functions that worked—unless they didn’t (edge cases with creating a weekday only task, setting start date on a Weekend, etc).

            else if (recurring === "daily-weekdays") {
                // We ignore the d.setDate(+1) and just find the next valid weekday from today
                let testDate = new Date(); 
                testDate.setDate(testDate.getDate() + 1);
                while (testDate.getDay() === 0 || testDate.getDay() === 6) {
                    testDate.setDate(testDate.getDate() + 1);
                }
                // Force 'd' to be this specific date, bypassing module interference
                d.setTime(testDate.getTime());
            
              } else if (recurring === "daily-weekends") {
                let testDate = new Date();
                testDate.setDate(testDate.getDate() + 1);
                while (testDate.getDay() >= 1 && testDate.getDay() <= 5) {
                    testDate.setDate(testDate.getDate() + 1);
                }
                d.setTime(testDate.getTime());
            

            14991c0d-e8fa-4d9d-95c1-d87e58757d59-image.png

            The logic is working (finally)- I wish I was better at this stuff, I’m a DevOps guy, so I’m lazy and not particularly talented at coding unless I can break thousands of servers with automation (then I’m a pro lol).

            I also went through and added the requisite language support for the 10 supported languages for the two new elements included in admin.html

                                  <div class="col-sm-auto">
                                    <select id="taskRecurring" class="form-select">
                                      <option value="">One time</option>
                                      <option value="daily">Daily</option>
                                      <option value="weekly">Weekly</option>
                                      <option value="daily-weekdays">Daily (Weekdays Only)</option>
                                      <option value="daily-weekends">Daily (Weekends Only)</option>
                                      <option value="monthly">Monthly</option>
                                      <option value="yearly">Yearly</option>
                                      <option value="every_X_days_2">Every 2 Days</option>
                                      <option value="every_X_days_3">Every 3 Days</option>
                                      <option value="every_X_weeks_2">Every 2 Weeks</option>
                                      <option value="every_X_weeks_3">Every 3 Weeks</option>
                                      <option value="first_monday_month">First Monday of Month</option>
                                    </select>
                                  </div>
            

            I’m testing a few .css changes to improve touchscreen support - you can see plenty of other .css issues I’ll nave to sort out, sreenshots from chrome of the MM page shows it’s not adjusting well to different browsers…

            9d065f9d-8c5e-4214-abd5-fdd57392da87-image.png

            I also put together a mini-module to provide a placard showing the options in the ‘reward store’ - My kid is super goal oriented, so being able to take advantage of @pierregode 's awesome reward system is going to be a big win!

            I’m going to look further into making this interactive and set up some kind of email to us to indicate she’s redeemed her coins on a particular reward.

            The current MMM-ChoreRewards is super crude and rude - you can see plenty of other .css issues I’ll have to sort out. @sdetweil hopefully I’ve formatted this post better - thank you for the #mod help!

            htilburgsH 1 Reply Last reply Reply Quote 1
            • htilburgsH Offline
              htilburgs @ewingfox
              last edited by htilburgs

              @pierregode
              I’m using dateFormatting: “” in my config, but I stil got the date on the dashboard. Do I somethine wrong?

                              {
                                module: "MMM-Chores",
                                position: "top_left",
                                header: "Takenlijst",
                                config: {
                                      updateInterval: 60 * 1000,
                                      adminPort: 5003,
                                      showDays: 365,
                                      showPast: true,
                                      dateFormatting: "",
                                      }
                              },
              

              194c5e22-2c1f-4839-b3a1-d688de98a8b1-image.png

              (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

              S PierreGodeP 2 Replies Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @htilburgs
                last edited by

                @htilburgs try

                dateFormatting:null

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • PierreGodeP Offline
                  PierreGode Module Developer @htilburgs
                  last edited by

                  @htilburgs
                  You can set it in the web in config page > Display Settings > Date format > Unassigned > Save

                  htilburgsH 2 Replies Last reply Reply Quote 1
                  • htilburgsH Offline
                    htilburgs @PierreGode
                    last edited by

                    @PierreGode said in MMM-Chores - Manage and keep track of your household Chores:

                    @htilburgs
                    You can set it in the web in config page > Display Settings > Date format > Unassigned > Save

                    I’m sorry for this late reaction. I’ll try this tomorrow (monday) when I have access to my mirror. Currently not at home. I let you Guys know the results.

                    (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

                    1 Reply Last reply Reply Quote 1
                    • htilburgsH Offline
                      htilburgs @PierreGode
                      last edited by

                      @PierreGode
                      Tested and works. Thanks!

                      (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        jtillinghast
                        last edited by sdetweil

                        Hey all-- I’m trying to get MMM-Chores working, but no matter what I do, the module shows up in the mirror as “No tasks to show (emoji).” I have populated the list with tasks, and confirmed that they appear in the data.json file. And I can reach the admin panel for Chores, so I know the server is running. Relevant codeblock from config.js:

                        {
                        					module: "MMM-Chores",
                        					position: "bottom_left",
                        					classes: "overview",
                        					header: "Chores",
                        					config: {
                        						updateInterval: 60 * 1000,
                        						adminPort: 5003,
                            					settings: "unlocked",
                        						dateFormatting: "",
                        						login: false,
                        						users: [{ username: "dad", password: "", permission: "read" }],
                        					}
                        				}
                        

                        I’m sure it’s something simple, so I appreciate your help! TIA.

                        PierreGodeP 1 Reply Last reply Reply Quote 0
                        • PierreGodeP Offline
                          PierreGode Module Developer @jtillinghast
                          last edited by

                          @jtillinghast
                          What does the command pm2 logs give you?

                          J 1 Reply Last reply Reply Quote 0
                          • J Offline
                            jtillinghast @PierreGode
                            last edited by

                            @PierreGode And of course, today it works for seemingly no other reason. I don’t believe I have touched anything in the module or the config since it wasn’t working, but now it looks good! I will continue to monitor. Thanks.

                            1 Reply Last reply Reply Quote 1
                            • J Offline
                              jtillinghast
                              last edited by

                              Question: Is it possible to set the config in some way to only show chores for one person? I’m using MMM-Pages to give each kid their own dashboard, for example, and I’m wondering if the page could just show the chores for that one person.

                              S 1 Reply Last reply Reply Quote 0
                              • S Do not disturb
                                sdetweil @jtillinghast
                                last edited by

                                @jtillinghast and then you need multiple instances in config.js

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                J 1 Reply Last reply Reply Quote 0
                                • J Offline
                                  jtillinghast @sdetweil
                                  last edited by

                                  @sdetweil Sure-- I have the multiple instances, but I’m just not sure what to put into the config to filter each instance down.

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Do not disturb
                                    sdetweil @jtillinghast
                                    last edited by

                                    @jtillinghast ok, takes a little extra coding for multiple instances. Just making sure that is handled too

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    J 1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      jtillinghast @sdetweil
                                      last edited by

                                      @sdetweil Can you say more about the extra coding? I created multiple instances, and assigned them to the unique pages via the class. Is there more unique configuration that needs to get handled?

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Do not disturb
                                        sdetweil @jtillinghast
                                        last edited by sdetweil

                                        @jtillinghast it’s inside the module, nothing you can do.
                                        Currently the module does not do this extra

                                        The module with a node helper sends a request to the helper
                                        The helper gets done and sends the response back

                                        But, the method we use which is fast and flexible,
                                        goes to ALL the same modules at once
                                        So read chore list, send back, all instances get the One list

                                        MagicMirror provides a unique identifier for each module entry in config.js . The trick is to send that identifier with the request
                                        And the helper sends it back with the data AND The modules checks to see if the identifier in the response matches its identifier.
                                        If not just ignore it.

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        J 1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jtillinghast @sdetweil
                                          last edited by

                                          @sdetweil Thanks-- I just want to be sure I’m understanding you correctly. You’re saying that it is not possible to filter the to-do list by individual person as the module is currently constructed. To do so, we would have to add a function which would be able to take in the person parameter from config and filter the data accordingly. If I’m following, that could be done in the module since it’s already performing a check to see if the information matches, but that would require further development.

                                          Am I on track?

                                          S 1 Reply Last reply Reply Quote 0
                                          • S Do not disturb
                                            sdetweil @jtillinghast
                                            last edited by

                                            @jtillinghast yes, AND it needs to add the this.identifier to the data it sends to the node_helper,
                                            and the node helper has to send that identifier back as part of the returned data, AND the module needs to check the identifier to make sure it matches

                                            else, filter for tasks Sue, send it back and ALL instance will get the tasks for Sue, even tho they asked for Bob or Bill.

                                            so the module needs to be enhanced for 2 different things…

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 5 / 6
                                            • 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