date element default not working (or i'm missing something very basic.

skyrun

Active Member
PHP:
if ('{srms_work_orders___status_raw}' == '3'
    or '{srms_work_orders___status_raw}' == '4'
    or '{srms_work_orders___status_raw}' == '6' ) {
    echo 'here';
      return date('m/d/y');
} else {
      return '';
};

trying to set the default date based on a status with the code above. 'here' displays so it's not a logic issue.

but it doesn't work. so tried just this:
PHP:
//return '2019-01-01';
return '01/01/19';

tried both lines, and neither worked to set this element. format of element is m/d/y

eval is set to YES.
 
Which exact Fabrik (3.9 or GitHub)?
I think you must return the raw date format (YYYY-MM-DD), it's doing on my site.

But the default is only run on new records, so your other element placeholders will be empty.
 
Yup, you'd have to return the default in "raw" (database) format ("Y-m-d H:i:s"), in whatever TZ you have elected to save as (so if "save as local", then your J! TZ, if not then UTC).

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top