• 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.

Calendar Module: How to declare local calendar

Scheduled Pinned Locked Moved Troubleshooting
13 Posts 5 Posters 9.5k Views 5 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.
  • Y Offline
    yawns Moderator @DazDavid
    last edited by Oct 20, 2016, 10:30 AM

    @DazDavid
    great, glad to help!

    1 Reply Last reply Reply Quote 0
    • B Offline
      bhepler Module Developer @cowboysdude
      last edited by bhepler Oct 20, 2016, 11:55 AM Oct 20, 2016, 11:15 AM

      @cowboysdude said in Calendar Module: How to declare local calendar:

      console.log(json.compliments.morning[0])

      I’m not programmer either but doesn’t this line just call the first object in the json file?

      Yes, it does. My test file has ten compliments loaded for each array (morning, afternoon & evening). That line was just to verify that I was getting a JSON object and not a file path. Which it does, meaning that I have the code reading from a local and parsing into a JSON object correctly. Now if I can just get that object in place of the default one, I’m golden.

      @strawberry-3-141 said in Calendar Module: How to declare local calendar:

      @bhepler something like this should do the job:
      move the call of complimentFile into the start method, you want to load that file only once not every 30 secs
      then override the the config compliments object with your data, that should be it

      Well, nuts. I inserted this code and now the config.compliments is undefined. But I do think you’ve got me on the right track. Thanks!

      compliments.js:67 Uncaught TypeError: Cannot read property 'length' of undefined
      
      B 1 Reply Last reply Oct 20, 2016, 11:55 AM Reply Quote 0
      • B Offline
        bhepler Module Developer @bhepler
        last edited by Oct 20, 2016, 11:55 AM

        Okay, thanks to @strawberry-3-141 expert advice, I have it up and running. The code he gave me is good, the JSON file I am loading from is not. We’ve got it sorted out and now I’m loading a compliment array from a file. Woohoo!

        1 Reply Last reply Reply Quote 0
        • 1
        • 2
        • 2 / 2
        2 / 2
        • First post
          11/13
          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