calculate_time calculates the time between two dates
The method Main.calculate_time is used in Midrub to calculate the time between two dates. I'm using same concept for the admin's panel too.
As you maybe seen, Main.calculate_time returns always the time in minutes, hours and days. But recently i've turned it in exact date for Edit Posts in the Posts app. How this is possible? Simply, create a new method and Midrub will return two dates(server and scheduled). Use the server date and browser date to calculate the difference. After use the difference to calculate the scheduled + difference. In this way you will get the correct date, hour and minutes.
Main.calculate_time has two parameters:
- from - contains the timestamp with time from.
- to - contains the timestamp with the time to.
You can custom this method as i've explained before the calculate the time in hours and date(if you need).
- How to create menu and submenu in a user's theme
- How to install the user's themes
- How to use Ajax in an user's theme
- How to use the JS pagination in Midrub
- calculate_time calculates the time between two dates
- Use a calendar in Midrub with show_calendar
- Show pagination in Midrub with JS code
- Display alerts in Midrub with popup_fon
- How to use in the best way the JS code in user's themes
- How to create a new menu for the user's panel