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-IdF-Transport - Never Miss Your Train/Metro/Bus/Tram in Île-de-France(Paris)!

    Scheduled Pinned Locked Moved Transport
    14 Posts 5 Posters 4.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.
    • Z Offline
      zarg404 @Nisnis39
      last edited by

      @Nisnis39 Do you plan to add a filter to this module ? And maybe a way to order the results ?
      thanks

      Z 1 Reply Last reply Reply Quote 0
      • Z Offline
        zarg404 @zarg404
        last edited by

        @zarg404 I made a PR for filtering the number of Stops to show

        N 1 Reply Last reply Reply Quote 1
        • N Offline
          Nisnis39 @zarg404
          last edited by

          @zarg404 It’s been added

          1 Reply Last reply Reply Quote 0
          • S Offline
            splaliv845
            last edited by

            Hi,
            Thanks for the work.
            I made a modification on my side to get number of minutes instead of ETA.
            Not super good at git nor dev so bellow is the modification I made if someone is interested and want to upadate the module.

            regards


            code update --> MMM-Idf-Transport.js
            replace all function --> createDataRow: function (routeObj)
            with :

            createDataRow: function (routeObj) {
            if (isNaN(routeObj.service.ExpectedDepartureTime))
            return null;

            // Calculate the difference in minutes between current time and departure time
            let currentTime = moment();
            let departureTime = moment(routeObj.service.ExpectedDepartureTime);
            let minutesDifference = departureTime.diff(currentTime, 'minutes');
            
            // Create the row
            let row = document.createElement("tr");
            
            let line = document.createElement("td");
            line.className = "line";
            line.innerHTML = routeObj.route.ID_Line;
            if (line.innerHTML)
                line.innerHTML = routeObj.route.lineHtml;
            row.appendChild(line);
            
            let destination = document.createElement("td");
            destination.className = "destination";
            destination.innerHTML = this.getDisplayString(routeObj.service.DestinationDisplay[0].value);
            row.appendChild(destination);
            
            let departure = document.createElement("td");
            departure.className = "departure";
            
            // Display the difference in minutes
            departure.innerHTML = `${minutesDifference} min`;
            
            row.appendChild(departure);
            
            return row;
            
            H 1 Reply Last reply Reply Quote 1
            • H Offline
              Horyzon @splaliv845
              last edited by

              Hi everyone,

              Thanks a lot for you guys’ work on this project, it will be quite helpful when I get it working on my machine.
              I currently have two issues:

              • I live in a city with two trainlines passing through the train station. I would be interested in seeing timetables for both lines, but I cannot get it working. One trainline or the other is fine, but not both.
              • For some reason, the module displays past trains. I used @splaliv845 code to convert the time to minutes to departure, and now I have negative values because the trains displayed are already gone. Any idea as to why, and how to correct it ?

              Thanks again guys !

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

                @Horyzon are you using two module instances in config.js for the two trains.

                for the negative times l if the time is negative don’t display that train

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Horyzon
                  last edited by

                  Hello,

                  I was happily using the module for a while now, but unfortunatly since the last update, the module doesn’t load and stays stuck on “loading…”.
                  I didn’t touch anything within the module itself, and all other modules have resume working just fine after the update, so I’m a bit lost. The logs aren’t helping me, but I’m very noobish with coding so that doesn’t help either.
                  Can anybody advise ? I’ll share logs if need be.

                  Thanks !

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

                    @Horyzon said in MMM-IdF-Transport - Never Miss Your Train/Metro/Bus/Tram in Île-de-France(Paris)!:

                    . The logs aren’t helping me

                    can u post them here?

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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

                      @Horyzon I posted a reply to your pending post. it contains private info. please correct it and resubmit

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

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