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 27 times
Subprocesso

Olá, alguém pode me ajudar na utiliz[…]

I am trying to make file upload field mandatory u[…]

Multiple Uploader in Grids

Are you trying to show all the uploaded files in[…]

Thanks!