Guide 21 - Calculation of days between two dates |
7/4/2021 5:52:50 PM |
PHPRunner Tips and Tricks | |
![]() This example I hope you help you something very common and it is calculate the days between two dates. This calculation is given in many systems (holiday management, hotel reservation, etc.). The calculation of days between two dates is a direct operation, do not know the types of days between the dates, that is, if the days are:
Objective Calculate the days between two dates, identifying if they are (natural, working, weekend and holidays). DEMO: https://fhumanes.com/date_diference You can use users admin and user1. The Password is the same as the Login. All the example can be downloaded from my portal |
|
![]() |
fhumanes author 7/4/2021 |
Solution The example is developed in Phprunner 10.2 to reach more developers and their appearance is:
In the example there are validations at JavaScript and PHP level. The codes for the EDIT action will be displayed, because it is something more complex than ADD. The event: JavaScript Onload Event: var ctrl_date_init = Runner.getControl(pageid, 'date_init'); The event: Before Record Updated: $id_user = $values['date_user_id']; For any questions or any other need, contact Email fernandohumanes@gmail.com. I leave you in my portal the example so that you can download it in your Windows and you can perform the tests and changes you need. |
S
|
Salaheddin 7/5/2021 |
Thank you Vmuch for your efforts |