Null field...is not null?

Hello!
I’m creating my own support class to do some stuff on my forms. So basically, i’m calculating the age based on Date of Birth, Date of Death and Current Date. I know that i can’t use, in a class specified on library, any sc methods. But i really need to organize my const, my constructors and any other kind of settings i need under a well scripted PHP CLASS.
So, my form can send, Date of Birth, so i calculate the age based on TODAY date, or can send Date of Birth and Date of Death, i calculate the age based on this diff.
The problem (???) is that in the method sc_date_empty($death_date) works to recognize empty/null date field (i can’t use it in php class - as i stated). But inside my class i noticed that the field, when should return empty/null/notset …effectively returns ‘null’ , but as string??? SO it’s not null at all…

Anyone can confirm this behaviour? Or help me to find out where i messed all out.
Thx u in advance.

Yep a ‘null’ string is what SC returns for empty date fields. I guess that’s why they come up with an ad-hoc macro (sc_date_empty).
Anyway, when I check for dates not using SC macros i just add a check for the string ‘null’ alongside the real null (just in case).

1 Like

Thank you so much for the explanation. I will mind it!