ProcessMaker code contributions

Moderator: amosbatto

By HeshanKaru1994
#824227
I would like to validate datetime control. Initially the current month should be used to this process.

If the current month between Jan-June then July to Dec should be disabled.
If the current month between July-Dec then Jan to June should be disabled.

Can I know whether this is possible

Thank you
User avatar
By amosbatto
#824247
Are you limiting the date to the current year?

Create the following trigger:
Code: Select all
$nMonth = (int) date("m");
if (nMonth < 7) {
    @@minDate = date("Y-01-01"); //Y will be replaced with the current year
    @@maxDate = date("Y-06-30"); 
}
else {
    @@minDate = date("Y-07-01"); 
    @@maxDate = date("Y-12-31");
} 
Set this trigger to fire before the Dynaform containing the datatime field.

Then, in the properties of your datetime field, set the min date property to: @@minDate
and set the max date property to: @@maxDate

This example will help you: https://wiki.processmaker.com/3.2/Datet ... _variables
User avatar
By amosbatto
#824283
The min date and max date properties limit the dates that can be selected with the date picker and datetime fields won't let you manually enter a date outside the bound.

If you don't see that, you probably didn't set something correctly. Here is a sample process to demonstrate it:
(24.48 KiB) Downloaded 19 times
Deleting the processes.

Are you sure that you are using version 1.245 f[…]

Changing the login page

In your pmos.conf, try changing from: Redir[…]

Clearing a datetime field

Is there a way to clear a date area inside of a […]

add dropdown to search process

I have to add dropdown list to search process. How[…]