MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. ewingfox
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    E
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 5
    • Groups 0

    ewingfox

    @ewingfox

    1
    Reputation
    1
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online
    Location Vermont, USA

    ewingfox Unfollow Follow

    Best posts made by ewingfox

    • RE: MMM-Chores - Manage and keep track of your household Chores

      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!

      posted in Utilities
      E
      ewingfox

    Latest posts made by ewingfox

    • OpenWeather API change to 3.0 - backwards compatible?

      Re: MMM-OpenWeatherMapForecast loading issue?

      Hello @sdetweil - I’ve tried the original and your fork - did these break when they moved to v 3.0?
      one-call-3)
      (figured I’d ask you before I wade in)

      rm -rf MMM-OpenWeatherMapForecast
      git clone https://github.com/sdetweil/MMM-OpenWeatherMapForecast
      cd MMM-OpenWeatheMapForecast
      npm install
      cd ~/MagicMirror/
      npm start

      … in both cases I get a ‘null’ error like the OP in the thread I’ve referenced.

      My config file entry:

              {
            module: "MMM-OpenWeatherMapForecast",
            header: "Weather",
            classes: "default everyone",
            position: "middle_center",
            config: {
              apikey: "API_KEY_REDACTED",
      	//latitude:        44.50498257209399,
      	//longitude:       -73.12579372208883,
          	latitude: 43.6930,
          	longitude: 4.2783,      
              iconset: "4c",
              concise: false,
              forecastLayout: "table"
            }
          },
      
      posted in Troubleshooting
      E
      ewingfox
    • RE: MMM-Chores - Manage and keep track of your household Chores

      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!

      posted in Utilities
      E
      ewingfox
    • RE: 24" Kitchen Infoboard with FireTV Stick

      @KamiSchami
      Hello!! This looks GREAT. I can muddle my way through back-end programming, but the front-end stuff is Greek to me - would you mind sharing what modules you have added, and a few hints about what you did with css to get this super clean look?

      I have a secret plan to try an gin up an organization board for my wife as a (late) Christmas gift - we’ll be out of the country so I’m trying to get as much done now as possible, but she’s a terrible beta tester - it has to be pretty dialed in to get her to buy in on using something (she’s a wonderful wife and mother however)

      Thank you in advance!

      E

      posted in Show your Mirror
      E
      ewingfox
    • RE: MMM-Chores - Manage and keep track of your household Chores

      @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

      posted in Utilities
      E
      ewingfox
    • RE: MMM-Chores - Manage and keep track of your household Chores

      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

      posted in Utilities
      E
      ewingfox