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 change the menu's icons in Midrub
- Midrub Payments Structure
- Midrub Stream Introduction
- How to boost posts automatically on Facebook, Instagram and Messenger
- Add Api permissions from your apps or components
- How to send email in Midrub and how understand why you're emails aren't sending
- How works the Quick Scheduler to publish posts with several clicks
- How to create a new menu for the user's panel
- the_db_request in midrub frontend themes
- Midrub Core Introduction