• Resolved ramonjosegn

    (@ramonjosegn)


    Hi, thanks for the plugin.

    I have a website about bus routes.

    I have been able to generate an excel table with the bus steps for each location.

    For example

    BUS 12
    bus-stop1: 12:50 am
    bus-stop2: 12:55 am
    bus-stop3: 13.00 pm
    etc

    However, I would like to know if with this plugin I could show the arrival time instead of the schedules, that is to say something like this

    BUS 12
    bus-stop1: arrival in 10 minutes
    bus-stop2: arrival in 15 minutes
    bus-stop3: arrival in 20 minutes

    Thanks for the help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bhagwad

    (@bhagwad)

    I would say you’d need to do the following:

    1. Use a shortcode to display the individual values of the times from your spreadsheet.

    It so happens that I’ve written a tutorial on exactly this using Google Spreadsheets:
    https://www.wp-tweaks.com/display-a-single-cell-from-google-sheets-wordpress/

    2. Use this calculate plugin to convert the start and end times into minutes from midnight and then subtract them from each other.

    P.S: It’ll probably be far, FAR easier to perform the calculations in another column of the spreadsheet itself and then display those values in WordPress using step (1).

    Thread Starter ramonjosegn

    (@ramonjosegn)

    HI, thanks for your answer

    curious solution, I don’t know if I can do the whole process, it seems a bit complex

    What are the steps to do “2. Use this calculate plugin to convert the start and end times into minutes from midnight and then subtract them from each other.”

    thx

    • This reply was modified 6 years, 5 months ago by ramonjosegn.
    Plugin Author bhagwad

    (@bhagwad)

    Well, it’s going to be complex and needs some programming code. You’ll need to separate the string into hours and minutes, multiply the minutes by 60, and add the extra minutes for the start and end times, then subtract.

    That’s why I suggested doing the calculations in Google spreadsheets and just displaying the value itself. It might look more complex, but I feel in the long run it’s more flexible.

    Thread Starter ramonjosegn

    (@ramonjosegn)

    It was very complex for me to create the formula to get the schedules (using statistics and with a lot of help).

    However, I would very much like to be able to show the results in the new format.

    How would you use the plugin to render and displaying the value data?

    Yesterday I did some tests but it was always 0

    • This reply was modified 6 years, 5 months ago by ramonjosegn.
    • This reply was modified 6 years, 5 months ago by ramonjosegn.
    Plugin Author bhagwad

    (@bhagwad)

    Converting a time of day to minutes requires some PHP code for sure. Because you need to extract the hours and minutes based on the separator colon (:). If you already have the data in a spreasheet however, then half your work is already done.

    What formula are you using in the spreadsheet to convert it into minutes?

    Thread Starter ramonjosegn

    (@ramonjosegn)

    Hi, thanks for support

    For change to minutes I am using mathematical division for 1440

    I upload the Excel file here

    https://drive.google.com/open?id=1jyFWMKtaoKus7rRkAF5N_QBGT6_oKvI2

    (its the first version, I have another version more detailed but I think has errors in the calculations, you can download here> https://drive.google.com/open?id=1jyFWMKtaoKus7rRkAF5N_QBGT6_oKvI2)

    The formula is based on some very simple statistical studies I found in some pdfs to predict the arrival of a bus (time, speed, number bus-stops, etc).

    I’m thinking of simplifying the formula even more so that I can publish it in google spreedsheat and use it in my blog.

    Perhaps it would be better to use only the intervals in minutes and discard the hours, I think that would make the process easier, since we would only have to subtract the minutes in which the bus arrives from the actual minute in the clock, could it be?

    The only problem is that the frequency changes during peak and off-peak hours.

    • This reply was modified 6 years, 5 months ago by ramonjosegn.
    • This reply was modified 6 years, 5 months ago by ramonjosegn.
    • This reply was modified 6 years, 5 months ago by ramonjosegn.
    • This reply was modified 6 years, 5 months ago by ramonjosegn.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Could you use the plugin to calculate the arrival of the next bus?’ is closed to new replies.